OFFSET
1,8
COMMENTS
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
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
KEYWORD
nonn
AUTHOR
Robert Israel, Jun 26 2025
STATUS
approved
