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.

Showing 1-1 of 1 results.

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

Original entry on oeis.org

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

Views

Author

Robert Israel, Jun 26 2025

Keywords

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.

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.
		

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
Showing 1-1 of 1 results.