%I #16 Apr 03 2024 19:55:08
%S 5,13,17,25,29,37,41,45,53,61,65,73,85,89,97,101,109,113,117,125,137,
%T 145,149,153,157,169,173,181,185,193,197,205,221,225,229,233,241,245,
%U 257,261,265,269,277,281,289,293,305,313,317,325,333,337,349,353,365,369,373,377
%N Numbers that are the sum of an even square > 0 and an odd square.
%e 13 is in the sequence since it is the sum of an even square > 0 and an odd square, 2^2 + 3^2 = 4 + 9 = 13.
%t 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, 500}] // Flatten
%o (Python)
%o def aupto(limit):
%o m = int(limit**.5) + 2
%o es = [i*i for i in range(2, m, 2)]
%o os = [i*i for i in range(1, m, 2)]
%o return sorted(set(a+b for a in es for b in os if a+b <= limit))
%o print(aupto(377)) # _Michael S. Branicky_, May 13 2021
%Y Cf. A000404, A010052, A057653, A097269.
%K nonn,easy
%O 1,1
%A _Wesley Ivan Hurt_, Dec 24 2020
|