OFFSET
1,9
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..10000
PROG
(PARI) a(n) = sum(x=1, n, sum(y=1, n, sum(z=1, n, sum(w=1, n, (gcd([x, y, z, w])==1)*(x*y+x*z+x*w+y*z+y*w+z*w==n)))));
(Python)
from math import gcd
from sympy import divisors, integer_nthroot
def A375004(n):
k = 0
for c in range(1, n-1):
for d in divisors(c, generator=True):
for x in range(1, d):
y = d-x
xy = x*y
a = (c//d)**2
b = a-(n-c-xy<<2)
if b>=0:
q, r = integer_nthroot(b, 2)
if r:
w = c//d+q>>1
z = c//d-w
if 1<=w<c//d and gcd(x, y, z, w)==1:
k += 1
if q:
w = c//d-q>>1
z = c//d-w
if 1<=w<c//d and gcd(x, y, z, w)==1:
k += 1
return k # Chai Wah Wu, Jul 27 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Seiichi Manyama, Jul 27 2024
STATUS
approved