A233418 a(n) is the smallest number k > 0 such that k^2+1, (k+1)^2+1,...,(k+n)^2+1 are composite numbers.
1, 3, 8, 7, 32, 31, 30, 29, 28, 27, 44, 43, 42, 41, 96, 95, 188, 187, 186, 185, 364, 363, 362, 361, 360, 359, 358, 357, 356, 355, 354, 353, 352, 351, 502, 501, 500, 499, 498, 497, 3396, 3395, 3394, 3393, 3392, 3391, 3578, 3577, 3576, 3575, 3574, 3573, 3572
Offset: 0
Keywords
Examples
a(0) = 1 because 1^2+1 is prime. a(1) = 3 because 3^2+1 is composite, but 4^2+1 is prime. a(2) = 8 because 8^2+1, 9^2+1 are composites, but 10^2+1 is prime. a(3) = 7 because 7^2+1, 8^2+1 and 9^2+1 are composites, but 10^2+1 is prime.
Links
- Michel Lagneau, Table of n, a(n) for n = 0..325
Programs
-
Maple
for n from 0 to 60 do: ii:=0:for k from 1 to 10^8 while(ii=0) do:i:=0:for m from 0 to n while(type((k+m)^2+1,prime)=false ) do :i:=i+1:od:if i=n then ii:=1: printf(`%d, `,k):else fi:od:od:
-
Mathematica
nn = 50; t = Table[0, {nn}]; cnt = 0; k = 0; While[cnt < nn, k++; i = 0; While[! PrimeQ[(k + i)^2 + 1], i++]; If[i < nn && t[[i + 1]] == 0, t[[i + 1]] = k; cnt++]]; t (* T. D. Noe, Dec 10 2013 *)