A385352 Number of sums i^2 + j^2 that occur more than once for 1 <= i <= j <= n.
0, 0, 0, 0, 0, 0, 1, 2, 3, 3, 5, 6, 8, 11, 12, 14, 18, 19, 24, 25, 29, 33, 40, 44, 47, 51, 57, 63, 68, 71, 80, 85, 91, 101, 106, 111, 118, 127, 136, 140, 151, 159, 168, 181, 187, 199, 208, 217, 229, 238, 249, 260, 276, 290, 300, 311, 324, 334, 347, 354, 368, 386, 402, 420, 429, 445, 462, 481, 497
Offset: 1
Keywords
Examples
a(9) = 3 because there are 3 sums i^2 + j^2 that occur more than once for 1 <= i <= j <= 9, namely 50 = 1^2 + 7^2 = 5^2 + 5^2, 65 = 1^2 + 8^2 = 4^2 + 7^2 and 85 = 2^2 + 9^2 = 6^2 + 10^2.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Crossrefs
Cf. A061790.
Programs
-
Maple
N:= 100: # for a(1) .. a(N) V:= Vector(2*N^2, datatype=integer[4]): R:= Vector(N): count:= 0: for n from 1 to N do for i from 1 to n do t:= i^2 + n^2; V[t]:= V[t]+1; if V[t] = 2 then count:= count+1 fi; od; R[n]:= count od: R:= convert(R, list);
-
Python
from collections import Counter def A385352(n): return sum(1 for a in Counter((i**2+j**2 for i in range(1,n+1) for j in range(1,i+1))).values() if a>1) # Chai Wah Wu, Jun 27 2025
Comments