A349121 a(n) is the smallest prime p, such that p + k + k^2 are consecutive primes for 0 <= k <= n, but not for k>n.
3, 5, 17, 347, 13901, 665111, 128981, 113575727, 2426256797, 137168442221, 4656625081181, 101951758179851, 484511389338941, 221860944705726407
Offset: 1
Examples
a(4)=347, because it is the smallest prime such that 347 + 2 = 349, 349 + 4 = 353, 353 + 6 = 359, 359 + 8 = 367 are 5 consecutive primes.
Crossrefs
Programs
-
Mathematica
Table[k=2;While[Flatten[k+(s={Range[0,n]})+s^2]!=NextPrime[k,Range[0,n]]||NextPrime[k,n+1]==k+n+1+(n+1)^2,k=NextPrime@k];k,{n,7}] (* Giorgos Kalogeropoulos, Nov 10 2021 *)
-
PARI
isok(p, n) = my(q=p); for (k=1, n, my(r = p+k+k^2); if (nextprime(q+1) != r, return (0)); q=r); return(1); a(n) = my(p=2); while (!isok(p, n), p=nextprime(p+1)); p; \\ Michel Marcus, Nov 09 2021
Comments