OFFSET
1,6
COMMENTS
a(n) = 0 if and only if n = 1 or n is prime. - Chai Wah Wu, Jul 26 2024
LINKS
Seiichi Manyama, Table of n, a(n) for n = 1..1000
FORMULA
EXAMPLE
a(6) = 4 since there are solutions (2,1,1,1), (1,2,1,1), (1,1,2,1), (1,1,1,2).
PROG
(PARI) a(n) = sum(x=1, n, sum(y=1, n, sum(z=1, n, sum(w=1, n, x*y+y*z+z*w+w*x==n))));
(Python)
from math import prod
from sympy import factorint
def A374969(n):
f = factorint(n).items()
return (n+1)*prod(e+1 for p, e in f)-(prod((p**(e+1)-1)//(p-1) for p, e in f)<<1) # Chai Wah Wu, Jul 26 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Seiichi Manyama, Jul 26 2024
STATUS
approved