OFFSET
0,2
COMMENTS
A sample of 54 terms found none with last digit 2,4,7, or 9, and both ending digit 0 and 5 had 17; 15 had final digit 1.
The square of 29 = a(20); a(47)-a(48)=1, probably the only time this will occur.
Eleven primes all ending in 1 were found.
FORMULA
For each pair of divisors d and d' of 2*n+1 with d*d'=2*n+1 and d<=d', find a and b to satisfy b-a=d and b+a=d', then compute a^2 + b^2. Find the sum of all these results.
If 2*n+1 is not a square, a(n)=sum[d(2*n+1)^2 {d(2*n+1) a divisor of 2*n+1}].
If 2*n+1 is a square, a(n)=(sum[d(2*n+1)^2 {d(2*n+1) a divisor of 2*n+1}] +
2*n+1)/2.
EXAMPLE
For n=31, 2*31+1=63=3^2*7, with divisors 1,3,7,9,21,63.
Grouping in pairs 1*63=(b-a)*(b+a) gives a=31 and b=32; 3*21=(b-a)*(b+a) gives a=9 and b=12; 7*9=(b-a)*(b+a) gives a=1 and b=8.
The sum 1^2 + 8^2 + 9^2 + 12^2 + 31^2 + 32^2 = 2275 = a(31).
PROG
(PARI) a(n)=my(b, N=2*n+1); sum(a=0, n, if(issquare(N+a^2, &b), a^2+b^2)) \\ Charles R Greathouse IV, Apr 28 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
J. M. Bergot, Apr 26 2014
EXTENSIONS
a(4) corrected by Charles R Greathouse IV, Apr 28 2014
STATUS
approved