OFFSET
1,1
EXAMPLE
a(2) = 13 is a term in the sequence since it is the sum of an even square > 0 and an odd square: 2^2 + 3^2 = 4 + 9 = 13.
MATHEMATICA
Table[If[Sum[Sign[(Mod[i, 2] Mod[n - i + 1, 2] + Mod[i + 1, 2] Mod[n - i, 2])] (Floor[Sqrt[i]] - Floor[Sqrt[i - 1]]) (Floor[Sqrt[n - i]] - Floor[Sqrt[n - i - 1]]), {i, Floor[n/2]}] > 0, n, {}], {n, 369}] // Flatten
PROG
(Python)
from math import isqrt
def aupto(limit):
m = isqrt(limit) + 2
es = [i*i for i in range(2, m, 2)]
os = [i*i for i in range(1, m, 2)]
return sorted(set(a+b for a in es for b in os if a+b <= limit))
print(aupto(377)) # Michael S. Branicky, May 13 2021
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Dec 24 2020
STATUS
approved
