login
A385352
Number of sums i^2 + j^2 that occur more than once for 1 <= i <= j <= n.
3
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,8
COMMENTS
First differs from A061790 at n = 18, where a(18) = 19 while A061790(18) = 20. This is due to the fact that 325 = 1^2 + 18^2 = 6^2 + 17^2 = 10^2 + 15^2.
LINKS
EXAMPLE
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.
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);
PROG
(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
CROSSREFS
Cf. A061790.
Sequence in context: A035938 A024503 A321286 * A061790 A107236 A192184
KEYWORD
nonn
AUTHOR
Robert Israel, Jun 26 2025
STATUS
approved