login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons 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

Table of n, a(n) for n=0..14.

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

Cf. A115786, A034386, A257466.

Sequence in context: A196874 A087571 A126018 * A255092 A237414 A051099

Adjacent sequences:  A257464 A257465 A257466 * A257468 A257469 A257470

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 | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 24 21:50 EDT 2021. Contains 345433 sequences. (Running on oeis4.)