OFFSET
1,1
COMMENTS
Numbers of the form 4k+2 = double of an odd number, with the odd number equal to the sum of 2 squares (sequence A057653). - Jean-Christophe Hervé, Oct 24 2015
Numbers that are the sum of two odd squares. - Jean-Christophe Hervé, Oct 25 2015
LINKS
Eric Weisstein's World of Mathematics, Sum of Squares Function.
EXAMPLE
2 = 1^2 + 1^2, 10 = 1^2 + 3^2, 18 = 3^2 + 3^2.
PROG
(PARI) is(n)=if(n%4!=2, return(0)); my(f=factor(n/2)); for(i=1, #f[, 1], if(bitand(f[i, 2], 1)==1&&bitand(f[i, 1], 3)==3, return(0))); 1 \\ Charles R Greathouse IV, May 31 2013
(Python)
from itertools import count, islice
from sympy import factorint
def A097269_gen(): # generator of terms
return filter(lambda n:all(p & 3 != 3 or e & 1 == 0 for p, e in factorint(n//2).items()), count(2, 4))
CROSSREFS
KEYWORD
nonn
AUTHOR
Ray Chandler, Aug 19 2004
STATUS
approved