OFFSET
1,2
LINKS
FORMULA
a(n) = Sum_{k=1..n} A364884(k).
EXAMPLE
For n = 3 the a(3) = 6 solutions (u, v, w, x_1, x_2) with positive u are (1, 0, 0, 0, 0), (1, -1, 0, 1, 0), (1, 0, -1, 1, -1), (1, 1, 0, 0, -1), (1, -2, 0, 2, 0), (1, 2, 0, 0, -2).
Equations multiplied by -1 do not have a different solution set, for example (-1, 1, 0, 1, 0) has the same solution set as (1, -1, 0, 1, 0).
MAPLE
A364384 := proc(n) local i, u, v, w, x_1, x_2, a; a := 0; i := n; for v from 1 - i to i - 1 do for w from abs(v) - i + 1 to i - abs(v) - 1 do u := i - abs(v) - abs(w); if igcd(u, v, w) = 1 then x_1 := 1/2*(-v + sqrt(v^2 - 4*w*u))/u; x_2 := 1/2*(-v - sqrt(v^2 - 4*w*u))/u; if floor(Re(x_1)) = x_1 and floor(Re(x_2)) = x_2 then a := a + 1; end if; end if; end do; end do; end proc;
PROG
(Python)
from math import gcd
from sympy import integer_nthroot
def A364385(n):
c = 0
for v in range(0, n):
for w in range(0, n-v):
for u in range(1, n-v-w+1):
if gcd(u, v, w)==1:
v2, w2, u2 = v*v, w*(u<<2), u<<1
if v2+w2>=0:
d, r = integer_nthroot(v2+w2, 2)
if r and not ((d+v)%u2 or (d-v)%u2):
c += 1
if v>0 and w>0:
c += 1
if v>0 and v2-w2>=0:
d, r = integer_nthroot(v2-w2, 2)
if r and not((d+v)%u2 or (d-v)%u2):
c += 1
if w>0:
c += 1
return c # Chai Wah Wu, Oct 04 2023
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Felix Huber, Jul 22 2023
STATUS
approved