OFFSET
1,1
LINKS
T. D. Noe, Table of n, a(n) for n = 1..10000
MATHEMATICA
nn = 10^3; ps = Prime[Range[PrimePi[Sqrt[nn]]]]; t = Flatten[Table[ps[[i]]^2 + ps[[j]]^2 + ps[[k]]^2, {i, Length[ps]}, {j, i, Length[ps]}, {k, j, Length[ps]}]]; t = Select[t, # <= nn &]; Union[t]
PROG
(Python)
from sympy import primerange as primes
from itertools import takewhile, combinations_with_replacement as mc
def aupto(N):
psqs = list(takewhile(lambda x: x<=N, (p**2 for p in primes(1, N+1))))
sum3 = set(sum(c) for c in mc(psqs, 3) if sum(c) <= N)
return sorted(sum3)
print(aupto(369)) # Michael S. Branicky, Dec 17 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
T. D. Noe, Jul 29 2012
STATUS
approved