The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A257467 Smallest prime number p such that p + psq(1), p + psq(2), ... p + psq(n) are all prime but p+psq(n+1) is not. (psq(n) is the square of the primorial.) 2
2, 3, 43, 7, 163, 397, 5527, 454543, 615883, 142516687, 68967673, 57502725253, 37520993053, 2630665498987, 39809897510563 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,1
LINKS
EXAMPLE
For prime 43, 43 + 4 and 43 + 36 are prime but not 43 + 30^2.
PROG
(PARI) psq(n)=my(P=1); forprime(p=2, prime(n), P*=p); P^2;
isokpsq(p, n) = {for (k=1, n, if (!isprime(p+psq(k)), return (0)); ); if (!isprime(p+psq(n+1)), return (1)); }
a(n) = {p = 2; while (!isokpsq(p, n), p = nextprime(p+1)); p; } \\ Michel Marcus, May 04 2015
(PARI) allprime(v, n=0)=for(i=1, #v, if(!isprime(v[i]+n), return(0))); 1
a(n)=if(n<2, return(n+2)); my(t=4, v=vector(n-1, i, t*=prime(i+1)^2), p=2); t*=prime(n+1)^2; forprime(q=3, , if(q-p==4 && allprime(v, p) && !isprime(t+p), return(p)); p=q) \\ Charles R Greathouse IV, May 05 2015
CROSSREFS
Sequence in context: A196874 A087571 A126018 * A255092 A237414 A051099
KEYWORD
hard,nonn
AUTHOR
Fred Schneider, Apr 25 2015
EXTENSIONS
a(13)-a(14) from Fred Schneider, May 16 2015
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 20 16:51 EDT 2024. Contains 372719 sequences. (Running on oeis4.)