OFFSET
0,3
EXAMPLE
For n = 1, (0, 0, 0, 1) is the only solution.
For n = 2, (0, 0, 0, 2) and (1, 1, 1, 1) are solutions, with 1 + 1 + 1 - 1 = 2.
PROG
(PARI) apply( {A353589(n, show=0, cnt=0, n2=n^2, e=[1, -1]~)=
for(a=0, sqrtint(n2\4), for(b=a, sqrtint((n2-a^2)\3),
my(s=[a+b, b-a, a-b, -a-b]); foreach(sum2sqr(n2-a^2-b^2), cd, cd[1] >= b &&
vecsum(cd)+s[1] >= n && foreach(s, d, (vecsum(cd)+d==n || abs(cd*e+d)==n)&&
cnt++&& !(show && print1(concat([a, b], cd)))&& break)))); cnt}, [0..99]) \\ See A133388 for sum2sqr().
CROSSREFS
KEYWORD
nonn
AUTHOR
M. F. Hasler, Jun 20 2022
STATUS
approved