cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A385352 Number of sums i^2 + j^2 that occur more than once for 1 <= i <= j <= n.

This page as a plain text file.
%I A385352 #11 Jun 27 2025 09:20:54
%S A385352 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,
%T A385352 63,68,71,80,85,91,101,106,111,118,127,136,140,151,159,168,181,187,
%U A385352 199,208,217,229,238,249,260,276,290,300,311,324,334,347,354,368,386,402,420,429,445,462,481,497
%N A385352 Number of sums i^2 + j^2 that occur more than once for 1 <= i <= j <= n.
%C A385352 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.
%H A385352 Robert Israel, <a href="/A385352/b385352.txt">Table of n, a(n) for n = 1..10000</a>
%e A385352 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.
%p A385352 N:= 100: # for a(1) .. a(N)
%p A385352 V:= Vector(2*N^2, datatype=integer[4]):
%p A385352 R:= Vector(N):
%p A385352 count:= 0:
%p A385352 for n from 1 to N do
%p A385352   for i from 1 to n do
%p A385352     t:= i^2 + n^2;
%p A385352     V[t]:= V[t]+1;
%p A385352     if V[t] = 2 then count:= count+1 fi;
%p A385352   od;
%p A385352   R[n]:= count
%p A385352 od:
%p A385352 R:= convert(R, list);
%o A385352 (Python)
%o A385352 from collections import Counter
%o A385352 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
%Y A385352 Cf. A061790.
%K A385352 nonn
%O A385352 1,8
%A A385352 _Robert Israel_, Jun 26 2025