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
CROSSREFS
KEYWORD
nonn
AUTHOR
Thorsten Ehlers, Jun 25 2024
STATUS
approved
