OFFSET
1,4
LINKS
Stefano Spezia, Table of n, a(n) for n = 1..10000
MATHEMATICA
a[n_]:=Sum[b Boole[IntegerQ[Sqrt[n-b^2]]], {b, 0, Floor[Sqrt[n]]}]; Array[a, 83] (* Stefano Spezia, May 15 2023 *)
PROG
(Python)
from gmpy2 import *
a = lambda n: sum([b for b in range(0, isqrt(n) + 1) if is_square(n - (b*b))])
print([a(n) for n in range(1, 84)])
(Python)
from sympy import divisors
from sympy.solvers.diophantine.diophantine import cornacchia
def A362961(n):
c = 0
for d in divisors(n):
if (k:=d**2)>n:
break
q, r = divmod(n, k)
if not r:
c += sum(d*(a[0]+(a[1] if a[0]!=a[1] else 0)) for a in cornacchia(1, 1, q) or [])
return c # Chai Wah Wu, May 15 2023
(PARI) a(n) = sum(b=0, sqrtint(n), if (issquare(n-b^2), b)); \\ Michel Marcus, May 16 2023
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Darío Clavijo, May 10 2023
STATUS
approved