login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A228495
Characteristic function of the odd odious numbers (A092246).
5
0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0
OFFSET
0,1
COMMENTS
The following sequences all appear to have the same parity: A003071, A029886, A061297, A092524, A093431, A102393, A104258, A122248, A128975. - Jeremy Gardiner, Dec 28 2008.
a(n+1) is the characteristic function of the even evil numbers (A125592). - Jeremy Gardiner, Feb 06 2015
FORMULA
a(2n) = 0, a(2n+1) = A092436(n).
a(n) = A000035(n) * A010060(n). - Antti Karttunen, Jan 12 2019
MATHEMATICA
a[n_] := If[OddQ[n] && OddQ[DigitCount[n, 2, 1]], 1, 0]; Array[a, 100, 0] (* Amiram Eldar, Aug 06 2023 *)
PROG
(PARI) a(n)=if(n%2==0, 0, subst(Pol(binary((n-1)/2)), x, 1)%2==0)
(PARI) A228495(n) = ((n%2)&&(hammingweight(n)%2)); \\ Antti Karttunen, Jan 12 2019
(Python)
def A228495(n): return n.bit_count()&1&n # Chai Wah Wu, Mar 03 2023
KEYWORD
nonn,base
AUTHOR
Ralf Stephan, Aug 23 2013
STATUS
approved