A365275 Number of integers k <= n that can be written as k = m^2+p^2 where p is a prime and m is a positive integer.
0, 0, 0, 0, 1, 1, 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 6, 6, 6, 6, 6, 7, 8, 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 11, 12, 12, 12, 12, 13, 13, 13, 13, 13, 14, 14, 14, 15, 15, 15, 15, 15, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 19, 19, 19, 19, 19, 20, 21, 21, 21, 21, 21, 21, 21
Offset: 1
Keywords
Links
- Andrew Granville, Cihan Sabuncu, and Alisa Sedunova, The multiplication table constant and sums of two squares, arXiv:2308.14911 [math.NT], 2023.
Crossrefs
Cf. A361300.
Programs
-
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 *)
-
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));