login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A374020 Number of solutions to a^2 + d^2 = b^2 + c^2 with 1 <= a < b < c < d <= n. 0
0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 4, 5, 7, 9, 10, 12, 15, 18, 23, 26, 29, 33, 39, 43, 48, 54, 60, 65, 74, 79, 87, 96, 105, 114, 122, 129, 140, 151, 162, 171, 185, 194, 210, 223, 233, 247, 264, 277, 293, 308, 323, 338, 360, 376, 392, 407, 425, 444, 468, 484 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,9
LINKS
EXAMPLE
For n = 9 the a(9) = 2 solutions are 1^2 + 8^2 = 4^2 + 7^2 = 65 and 2^2 + 9^2 = 6^2 + 7^2 = 85.
For n = 18 three of the a(18) = 18 solutions sum up to 325: 1^2 + 18^2 = 6^2 + 17^2 = 10^2 + 15^2.
PROG
(C) #include <stdio.h>
#define N 10000ULL
typedef unsigned long long ull_t;
ull_t Sums[2 * N * N];
int main() {
ull_t sol = 0;
for (ull_t i = 1; i < N; i++)
for (ull_t j = i + 1; j <= N; j++)
sol += Sums[i * i + j * j]++;
printf("%llu \n", sol);
}
(Python)
from itertools import count, islice
from collections import Counter
def A374020_gen(): # generator of terms
c, s = 0, Counter()
for n in count(1):
n2 = n**2
for i in range(1, n):
c += s[m:=i**2+n2]
s[m] += 1
yield c
A374020_list = list(islice(A374020_gen(), 20)) # Chai Wah Wu, Jul 18 2024
CROSSREFS
Sequence in context: A058678 A241410 A324753 * A283106 A030769 A030739
KEYWORD
nonn
AUTHOR
Thorsten Ehlers, Jun 25 2024
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 16 19:19 EDT 2024. Contains 375177 sequences. (Running on oeis4.)