A356567 Numbers that generate increasing numbers of consecutive primes when doubled and added to the sequence of odd squares. (Positions of records in A354499.)
1, 2, 11, 29, 326
Offset: 1
Examples
a(1)=1, because 1^2+2*1=3 and 3^2+2*1=11 are prime but 5^2+2*1=27 is not, and thus k=2. a(2)=2, because 1^2+2*2=5 ... 7^2+2*2=53 are prime but 9^2+2*2=85 is not, thus k=4. a(3)=11, because 1^2+2*11=23 ... 9^2+2*11=103 are prime, thus k=5. a(4)=29, because 1^2+2*29=59 ... 27^2+2*29=787 are all prime, thus k=14. a(5)=326 because 1^2+2*326=653 ... 35^2+2*352=1877 are all prime, thus k=18.
Crossrefs
Programs
-
Mathematica
f[n_] := Module[{k = 1}, While[PrimeQ[k^2 + 2*n], k += 2]; (k - 1)/2]; s = {}; fm = 0; Do[If[(fn = f[n]) > fm, fm = fn; AppendTo[s, n]], {n, 1, 10^3}]; s (* Amiram Eldar, Aug 15 2022 *)
-
PARI
f(n) = my(k=1); while (isprime(k^2+2*n), k+=2); (k-1)/2; \\ A354499 lista(nn) = my(m=0); for (n=1, nn, my(x = f(n)); if (x > m, m = x; print1(n, ", "));); \\ Michel Marcus, Aug 16 2022
Comments