OFFSET
0,3
FORMULA
EXAMPLE
23 is in the sequence because 23 in binary is 10111. The sum of digits is 4 == 0 mod 2 and the products of digits is 0 == 0 mod 2.
PROG
(JavaScript)
for (i=0; i<1000; i++) {
s=i.toString(2).split("");
sl=s.length;
c=0; d=1;
for (j=0; j<sl; j++) {c+=s[j]*1; d*=s[j]; }
c%=2; d%=2;
if (c==d) document.write(i+", ");
}
(PARI) is(n)=b=binary(n); sum(i=1, #b, b[i])%2==prod(i=1, #b, b[i])%2 \\ Ralf Stephan, Nov 30 2013
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Jon Perry, Nov 28 2013
STATUS
approved