A218209 Number of n-digit primes that are of the form (k-2)^2 + (k-1)^2 + k^2.
2, 1, 3, 4, 12, 31, 86, 230, 681, 1934, 5634, 15772
Offset: 1
Programs
-
Mathematica
n = -1; Table[cnt = 0; While[n++; p = 3*n^2 + 2; p < 10^e, If[PrimeQ[p], cnt++]]; n--; cnt, {e, 10}] (* T. D. Noe, Oct 23 2012 *) Table[Count[Table[Total[Range[n,n+2]^2],{n,-1,600000}],?(PrimeQ[#] && IntegerLength[#]==k&)],{k,12}] (* _Harvey P. Dale, Oct 17 2016 *)