A228495 Characteristic function of the odd odious numbers (A092246).
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
Links
- Antti Karttunen, Table of n, a(n) for n = 0..65537
- Tanya Khovanova, There are no coincidences, arXiv preprint 1410.2193 [math.CO], 2014.
- Index entries for characteristic functions.
- Index entries for sequences related to binary expansion of n.
Crossrefs
Programs
-
Mathematica
a[n_] := If[OddQ[n] && OddQ[DigitCount[n, 2, 1]], 1, 0]; Array[a, 100, 0] (* Amiram Eldar, Aug 06 2023 *)
-
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
Formula
a(2n) = 0, a(2n+1) = A092436(n).
Comments