login
Smallest prime which can be written as k^2 + n for k >= 0.
4

%I #8 Aug 03 2014 14:01:16

%S 2,2,3,5,5,7,7,17,13,11,11,13,13,23,19,17,17,19,19,29,37,23,23,73,29,

%T 107,31,29,29,31,31,41,37,43,71,37,37,47,43,41,41,43,43,53,61,47,47,

%U 73,53,59,67,53,53,79,59,137,61,59,59,61,61,71,67,73,101,67,67,149,73,71

%N Smallest prime which can be written as k^2 + n for k >= 0.

%F a(n) = A056897(n)+n = A056898(n)^2+n.

%F For p a prime: a(p)=p (and a(p-1)=p if p<>3).

%e a(8)=17 because 17=3^2+8.

%t Table[k = 0; While[p = n + k^2; ! PrimeQ[p], k++]; p, {n, 100}] (* _T. D. Noe_, Apr 01 2011 *)

%Y Cf. A000040, A002496, A056892-A056898.

%K nonn

%O 1,1

%A _Henry Bottomley_, Jul 05 2000

%E Example corrected by Harvey P. Dale, Apr 01 2011