OFFSET
1,1
COMMENTS
LINKS
Griffin N. Macris, Table of n, a(n) for n = 1..500
EXAMPLE
a(1) = 16 = 2^2 + 2^2 + 2^2 + 2^2 = 0^2 + 0^2 + 4^2.
PROG
(Sage)
n=340 #change for more terms
P=prime_range(1, ceil(sqrt(n)))
S=cartesian_product_iterator([P, P, P, P])
A=list(Set([sum(i^2 for i in y) for y in S if sum(i^2 for i in y)<=n]))
A.sort()
T=[sum(i^2 for i in y) for y in cartesian_product_iterator([[0..ceil(sqrt(n))], [0..ceil(sqrt(n))], [0..ceil(sqrt(n))]])]
[x for x in A if x in T] # Tom Edgar, Mar 24 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
Griffin N. Macris, Mar 23 2016
STATUS
approved