cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-3 of 3 results.

A113451 Integers n such that prime(n+1) - prime(n) is a power.

Original entry on oeis.org

1, 4, 6, 8, 12, 14, 19, 22, 24, 25, 27, 29, 31, 38, 44, 48, 50, 59, 63, 65, 70, 72, 75, 77, 78, 79, 85, 87, 88, 90, 92, 93, 94, 95, 112, 117, 122, 124, 126, 128, 131, 132, 134, 135, 136, 143, 147, 149, 151, 153, 155, 156, 158, 159, 163, 166, 169, 181, 183, 186, 192, 196
Offset: 1

Views

Author

Walter Kehowski, Jan 08 2006

Keywords

Examples

			87 is in the sequence since prime(88) - prime(87) = 457 - 449 = 8 = 2^3.
		

Crossrefs

Programs

  • Maple
    egcd := proc(n) local L; L:=ifactors(n)[2]; L:=map(proc(z) z[2] end, L); igcd(op(L)) end; M:=[]: cnt:=0: for z to 1 do for k from 1 to 200 do p:=ithprime(k); q:=nextprime(p); x:=q-p; if egcd(x)>1 then cnt:=cnt+1; M:=[op(M), [cnt,k,x]] fi od od; M; map(proc(z) z[3] end, M);
  • Mathematica
    f[n_] := GCD @@ Last /@ FactorInteger[n] != 1; Select[Range[200], f[Prime[ # + 1] - Prime[ # ]] &] (* Ray Chandler, Oct 19 2006 *)

Extensions

Edited by Ray Chandler, Oct 19 2006

A123995 First occurrence of prime gaps which are perfect powers.

Original entry on oeis.org

2, 7, 89, 1831, 5591, 9551, 89689, 396733, 3851459, 11981443, 70396393, 202551667, 1872851947, 10958687879, 47203303159, 767644374817, 1999066711391, 8817792098461, 78610833115261, 497687231721157, 2069461000669981
Offset: 1

Views

Author

Walter Kehowski, Oct 31 2006

Keywords

Comments

So far the powers have occurred in numerical order. Here is the list of primes and powers: [7, 4], [89, 8], [1831, 16], [5591, 32], [9551, 36], [89689, 64], [396733, 100], [3851459, 128], [11981443, 144], [70396393, 196], [202551667, 216], [1872851947, 256], [10958687879, 324]. I have searched out to the prime p=26689111613.
The old definition was confusing. What is meant was: primes p such that nextprime(p)-p is an element of A001597 (or A075090: even perfect powers, for n > 1), and p is the smallest prime followed by this gap. - M. F. Hasler, Oct 18 2018
A138198 is a subsequence. - M. F. Hasler, Oct 18 2018

Examples

			a(2)=89 since nextprime(89)-89=97-89=8 is the first occurrence of 8 as a difference between successive primes.
		

Crossrefs

Cf. A080370, A113472, A000230, A001597 (perfect powers), A075090, A002386, A138198.

Programs

  • Maple
    with(numtheory); egcd := proc(n::posint) local L; if n>1 then L:=ifactors(n)[2]; L:=map(z->z[2],L); return igcd(op(L)) else return 1 fi end: P:={}; Q:=[]; p:=2; for w to 1 do for k from 0 do # keep track if k mod 10^6 = 0 then print(k,p) fi; lastprime:=p; q:=nextprime(p); d:=q-p; x:=egcd(d); if x>1 and not d in P then P:=P union {d}; Q:=[op(Q), [p,d]]; print(p,d); print(P); print(Q); fi ; p:=q; od od; # let it run with AutoSave enabled.
  • Mathematica
    NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ@k, k++ ]; k]; perfectPowerQ[x_] := GCD @@ Last /@ FactorInteger@x > 1; dd = {1}; pp = {2}; qq = {3}; p = 3; Do[q = NextPrim@p; d = q - p; If[perfectPowerQ@d && ! MemberQ[dd, d], Print@q; AppendTo[pp, p]; AppendTo[dd, d]]; p = q, {n, 10^7}]; pp (* Robert G. Wilson v, Nov 03 2006 *)
  • PARI
    S=[];print1(p=2);forprime(q=1+p,,ispower(q-p)&& !setsearch(S,q-p)&& !print1(","p)&& S=setunion(S,[q-p]);p=q) \\ M. F. Hasler, Oct 18 2018

Formula

Previous prime before A123996.

Extensions

Edited and extended by Robert G. Wilson v, Nov 03 2006 and corrected Nov 04 2006
Better definition from M. F. Hasler, Oct 18 2018

A123996 Smallest prime q such that the gap between q and the previous prime is a perfect power that has not occurred earlier as a gap.

Original entry on oeis.org

3, 11, 97, 1847, 5623, 9587, 89753, 396833, 3851587, 11981587, 70396589, 202551883, 1872852203, 10958688203, 47203303559, 767644375301, 8817792099037, 78610833115937, 497687231721941, 2069461000670881
Offset: 1

Views

Author

Walter Kehowski, Oct 31 2006

Keywords

Comments

So far the powers have occurred in numerical order. Here is the list of primes and powers: [11, 4], [97, 8], [1847, 16], [5623, 32], [9587, 36], [89753, 64], [396833, 100], [3851587, 128], [11981587, 144], [70396589, 196], [202551883, 216], [1872852203, 256], [10958688203, 324]. I have searched out to the prime p=26689111613.

Examples

			a(2)=97 since 97-prevprime(97)=97-89=8 is the first occurrence of 8 as a difference between successive primes.
		

Crossrefs

Programs

  • Maple
    with(numtheory); egcd := proc(n::posint) local L; if n>1 then L:=ifactors(n)[2]; L:=map(z->z[2],L); return igcd(op(L)) else return 1 fi end: P:={}; Q:=[]; p:=2; for w to 1 do for k from 0 do # keep track if k mod 10^6 = 0 then print(k,p) fi; lastprime:=p; q:=nextprime(p); d:=q-p; x:=egcd(d); if x>1 and not d in P then P:=P union {d}; Q:=[op(Q), [q,d]]; print(q,d); print(P); print(Q); fi ; p:=q; od od; # let it run with AutoSave enabled.
  • Mathematica
    NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ@k, k++ ]; k]; perfectPowerQ[x_] := GCD @@ Last /@ FactorInteger@x > 1; dd = {1}; pp = {2}; qq = {3}; p = 3; Do[q = NextPrim@p; d = q - p; If[perfectPowerQ@d && !MemberQ[dd, d], Print@q; AppendTo[qq, q]; AppendTo[dd, d]]; p = q, {n, 10^7}]; qq (* Robert G. Wilson v, Nov 03 2006 *)

Formula

Next prime after A123995.

Extensions

Edited and extended by Robert G. Wilson v, Nov 03 2006, corrected Nov 04 2006
Definition corrected by M. F. Hasler, Oct 19 2018
Showing 1-3 of 3 results.