OFFSET
1,2
COMMENTS
LINKS
Nicolay Avilov, Explanatory drawing
Nicolay Avilov, Multiplication table for sequence
EXAMPLE
0 is a term since it is the square of the chord length from (0,0) to (0,0).
10 = 1^2 + 3^2 is a term since it is the square of the chord length from (1,1) to (2,4).
PROG
(Python)
# Program from Oleg Sorokin
from math import isqrt
limit = 2000
s = set()
end = isqrt(limit)
for m in range(0, end+1):
for k in range(m%2, end+1, 2):
c = m**2*(k**2+1)
if c > limit:
break
s.add(c)
print(sorted(s))
(Python)
from itertools import count, islice
from sympy import divisors, integer_nthroot
def A358317_gen(startvalue=0): # generator of terms >= startvalue
for n in count(max(startvalue, 0)):
if n == 0:
yield 0
else:
for d in divisors(n, generator=True):
a, b = integer_nthroot(d, 2)
if b:
c, e = integer_nthroot(n//d-1, 2)
if e and not (c^a)&1:
yield n
break
CROSSREFS
KEYWORD
nonn
AUTHOR
Nicolay Avilov, Nov 09 2022
STATUS
approved