OFFSET
1,1
COMMENTS
This sequence can easily be shown to be infinite. Take p, q, r equal and congruent to 1 mod 16, and s = 5. Then, because p = 1+16k, n = 28 + 96k + 768k^2, and n = 4*(7+8*m) for m = 3k+24k^2. Then, following from Legendre's three-square theorem, n cannot be written as a^2 + b^2 + c^2 for any a, b, c in the integers. Then, because there are infinitely many primes of the form p = 1+16k, this sequence is infinite.
It appears at first that all Mersenne numbers (A000225) are included in this sequence. However, this is not the case. The first counterexample is 262143 = 2^18 - 1. The next are 4194303 = 2^22 - 1 and 16777215 = 2^24 - 1.
LINKS
Griffin N. Macris, Table of n, a(n) for n = 1..500
EXAMPLE
31 = 2^2 + 3^2 + 3^2 + 3^2, and, according to Legendre's three-square theorem, 31 cannot be expressed as the sum of three squares, so 31 is a term.
PROG
(Sage)
n=487 #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 not(x in T)] # Tom Edgar, Mar 24 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
Griffin N. Macris, Mar 23 2016
STATUS
approved