login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A237626
Sum of a^2 + b^2 for all nonnegative integers a,b such that b^2-a^2 = 4n.
2
4, 10, 20, 50, 52, 100, 100, 170, 200, 260, 244, 420, 340, 500, 520, 714, 580, 910, 724, 1092, 1000, 1220, 1060, 1700, 1352, 1700, 1640, 2100, 1684, 2600, 1924, 2730, 2440, 2900, 2600, 3894, 2740, 3620, 3400, 4420, 3364, 5000, 3700, 5124, 4732, 5300, 4420, 6820, 5000
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
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
Sequence in context: A048019 A189586 A019498 * A020149 A056412 A032275
KEYWORD
nonn
AUTHOR
J. M. Bergot, Apr 22 2014
STATUS
approved