OFFSET
1,8
LINKS
Andrew Granville, Cihan Sabuncu, and Alisa Sedunova, The multiplication table constant and sums of two squares, arXiv:2308.14911 [math.NT], 2023.
MATHEMATICA
a={}; For[n=1, n<=80, n++, nk=0; For[k=1, k<=n, k++, flag=1; For[m=1, m<=Sqrt[k]&&flag==1, m++, sp=Sqrt[k-m^2]; If[IntegerQ[sp^2]&&PrimeQ[sp], nk++; flag=0]]]; AppendTo[a, nk]]; a (* Stefano Spezia, Aug 30 2023 *)
PROG
(PARI) isok(k) = my(q); for(i=1, sqrtint(k), if (issquare(q=k-i^2) && isprime(sqrtint(q)), return(1))); return(0);
a(n) = sum(k=1, n, isok(k));
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Marcus, Aug 30 2023
STATUS
approved