OFFSET
0,2
COMMENTS
LINKS
Indranil Ghosh, Table of n, a(n) for n = 0..25000 (terms 0..1000 from T. D. Noe)
Jean Paul Allouche, Jeffrey Shallit, and Guentcho Skordev, Self-generating sets, integers with missing blocks and substitutions, Discrete Math. 292 (2005) 1-15.
Clark Kimberling, Affinely recursive sets and orderings of languages, Discrete Math., 274 (2004), 147-160. [From N. J. A. Sloane, Jan 31 2012]
Jeffrey Shallit, Additive Number Theory via Automata and Logic, arXiv:2112.13627 [math.NT], 2021.
Wadim Zudilin, A strange identity of an MF (Mahler function), arXiv:2403.13604 [math.NT], 2024.
FORMULA
a(0) = 1, a(2n) = -a(n) + 6n + 1, a(2n+1) = a(n) + 2n + 2. a(n) = 2n+1 - 1/2(1-(-1)^A023416(n)) = 2n+1 - A059448(n). - Ralf Stephan, Sep 17 2003
MATHEMATICA
Select[Range[130], EvenQ @ DigitCount[#, 2, 0] &] (* Jean-François Alcover, Apr 11 2011 *)
PROG
(PARI) is(n)=hammingweight(bitneg(n, #binary(n)))%2==0 \\ Charles R Greathouse IV, Mar 26 2013
(PARI) a(n) = if(n==0, 1, 2*n + (logint(n, 2) - hammingweight(n)) % 2); \\ Kevin Ryde, Mar 11 2021
(Haskell)
a059010 n = a059010_list !! (n-1)
a059010_list = filter (even . a023416) [1..]
-- Reinhard Zumkeller, Jan 21 2014
(Python)
#Program to generate the b-file
i=1
j=0
while j<=250:
if bin(i)[2:].count("0")%2==0:
print(str(j)+" "+str(i))
j+=1
i+=1 # Indranil Ghosh, Feb 03 2017
(R)
maxrow <- 4 # by choice
onezeros <- 1
for(m in 1:(maxrow+1)){
row <- onezeros[2^(m-1):(2^m-1)]
onezeros <- c(onezeros, c(1-row, row) )
}
a <- which(onezeros == 1)
a
# Yosu Yurramendi, Mar 28 2017
CROSSREFS
Cf. A059009 (complement).
KEYWORD
nonn,easy,base,nice
AUTHOR
Patrick De Geest, Dec 15 2000
EXTENSIONS
Name clarified by Antti Karttunen, Mar 28 2017
STATUS
approved