OFFSET
1,3
COMMENTS
LINKS
Mathematics StackExchange, Large smallest square in a sum of three squares?
MAPLE
f:= proc(n) local q, x, y, z;
if n/4^padic:-ordp(n, 4) mod 8 = 7 then return -1 fi;
for x from 0 while 3*x^2 <= n do
if [isolve(y^2 + z^2 = n - x^2)] <> [] then return x fi
od;
end proc:
V:= NULL:count:= 0: m:= -1;
for i from 0 while count < 39 do
v:= f(i);
if v > m then
V:= V, v; m:= v; count:=count+1
fi
od:
V;
PROG
(Python)
from itertools import count, islice
from math import isqrt
from sympy import factorint
def A375204_gen(): # generator of terms
c = -1
for n in count(0):
v = (~n & n-1).bit_length()
if v&1 or n>>v&7!=7:
a = next(x for x in range(isqrt(n//3)+1) if not any(e&1 and p&3==3 for p, e in factorint(n-x**2).items()))
if a>c:
yield a
c = a
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Robert Israel, Oct 15 2024
EXTENSIONS
a(35)-a(48) from Chai Wah Wu, Oct 16 2024
a(49)-a(52) from Chai Wah Wu, Oct 17 2024
STATUS
approved