A097269 Numbers that are the sum of two nonzero squares but not the difference of two nonzero squares.
2, 10, 18, 26, 34, 50, 58, 74, 82, 90, 98, 106, 122, 130, 146, 162, 170, 178, 194, 202, 218, 226, 234, 242, 250, 274, 290, 298, 306, 314, 338, 346, 362, 370, 386, 394, 410, 442, 450, 458, 466, 482, 490, 514, 522, 530, 538, 554, 562, 578, 586, 610, 626, 634
Offset: 1
Keywords
Examples
2 = 1^2 + 1^2, 10 = 1^2 + 3^2, 18 = 3^2 + 3^2.
Links
- Eric Weisstein's World of Mathematics, Sum of Squares Function.
Crossrefs
Programs
-
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)) A097269_list = list(islice(A097269_gen(),30)) # Chai Wah Wu, Jun 28 2022
Comments