OFFSET
1,1
COMMENTS
In the first 50 entries, the final digit is either 0, 2, or 4. Does 6 or 8 ever occur as the last digit?
a(121) = 29768, a(605) = 767676. - Alois P. Heinz, Apr 24 2014
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000
FORMULA
For each pair of divisors d and d' of 4n with d*d'=4n and d<=d' find a and b satisfying b-a=d and b+a=d' and compute a^2+b^2. Add all of the results together.
EXAMPLE
When n=12, we get 4*12=48 and then 48 = 13^2-11^2 = 8^2-4^2 = 7^2-1^2. So a(12) = 1^2+7^2+4^2+8^2+11^2+13^2 = 420.
MATHEMATICA
a[n_] := Module[{a, b}, a^2 + b^2 /. {ToRules[Reduce[0 <= a < b && b^2 - a^2 == 4n, {a, b}, Integers]]} // Total];
a /@ Range[1, 50] (* Jean-François Alcover, Oct 06 2019 *)
PROG
(PARI) a(n)=my(b); sum(a=0, n-1, if(issquare(a^2+4*n, &b), a^2+b^2)) \\ Charles R Greathouse IV, Apr 22 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
J. M. Bergot, Apr 22 2014
STATUS
approved