login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A218214
Number of primes up to 10^n representable as sums of consecutive squares.
1
1, 5, 18, 48, 117, 304, 823, 2224, 6113, 16974, 48614, 139349
OFFSET
1,2
COMMENTS
There are no common representations of two, three or six squares for n < 13, so
a(n) = A218208(n) + A218210(n) + A218212(n); n < 13.
FORMULA
a(n) = sum(A218213(k),k=1..n)
EXAMPLE
a(1) = 1 because only one prime less than 10 can be represented as a sum of consecutive squares, namely 5 = 1^2 + 2^2.
a(2) = 5 because there are five primes less than 100 representable as a sum of consecutive squares: the aforementioned 5, as well as 13 = 2^2 + 3^2, 29 = 2^2 + 3^2 + 4^2, 41 = 4^2 + 5^2 and 61 = 5^2 + 6^2.
MATHEMATICA
nn = 8; nMax = 10^nn; t = Table[0, {nn}]; Do[k = n; s = 0; While[s = s + k^2; s <= nMax, If[PrimeQ[s], t[[Ceiling[Log[10, s]]]]++]; k++], {n, Sqrt[nMax]}]; Accumulate[t] (* T. D. Noe, Oct 23 2012 *)
KEYWORD
nonn,base
AUTHOR
Martin Renner, Oct 23 2012
STATUS
approved