cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A059010 Natural numbers having an even number of nonleading zeros in their binary expansion.

This page as a plain text file.
%I A059010 #70 Mar 23 2024 20:03:08
%S A059010 1,3,4,7,9,10,12,15,16,19,21,22,25,26,28,31,33,34,36,39,40,43,45,46,
%T A059010 48,51,53,54,57,58,60,63,64,67,69,70,73,74,76,79,81,82,84,87,88,91,93,
%U A059010 94,97,98,100,103,104,107,109,110,112,115,117,118,121,122,124,127,129,130
%N A059010 Natural numbers having an even number of nonleading zeros in their binary expansion.
%C A059010 Positions of ones in A298952, and of zeros in A059448. - _John Keith_, Mar 09 2022
%H A059010 Indranil Ghosh, <a href="/A059010/b059010.txt">Table of n, a(n) for n = 0..25000</a> (terms 0..1000 from T. D. Noe)
%H A059010 Jean Paul Allouche, Jeffrey Shallit, and Guentcho Skordev, <a href="http://dx.doi.org/10.1016/j.disc.2004.12.004">Self-generating sets, integers with missing blocks and substitutions</a>, Discrete Math. 292 (2005) 1-15.
%H A059010 Clark Kimberling, <a href="http://dx.doi.org/10.1016/S0012-365X(03)00085-2">Affinely recursive sets and orderings of languages</a>, Discrete Math., 274 (2004), 147-160. [From _N. J. A. Sloane_, Jan 31 2012]
%H A059010 Jeffrey Shallit, <a href="https://arxiv.org/abs/2112.13627">Additive Number Theory via Automata and Logic</a>, arXiv:2112.13627 [math.NT], 2021.
%H A059010 Wadim Zudilin, <a href="https://arxiv.org/abs/2403.13604">A strange identity of an MF (Mahler function)</a>, arXiv:2403.13604 [math.NT], 2024.
%H A059010 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>
%F A059010 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
%t A059010 Select[Range[130], EvenQ @ DigitCount[#, 2, 0] &] (* _Jean-François Alcover_, Apr 11 2011 *)
%o A059010 (PARI) is(n)=hammingweight(bitneg(n,#binary(n)))%2==0 \\ _Charles R Greathouse IV_, Mar 26 2013
%o A059010 (PARI) a(n) = if(n==0,1, 2*n + (logint(n,2) - hammingweight(n)) % 2); \\ _Kevin Ryde_, Mar 11 2021
%o A059010 (Haskell)
%o A059010 a059010 n = a059010_list !! (n-1)
%o A059010 a059010_list = filter (even . a023416) [1..]
%o A059010 -- _Reinhard Zumkeller_, Jan 21 2014
%o A059010 (Python)
%o A059010 #Program to generate the b-file
%o A059010 i=1
%o A059010 j=0
%o A059010 while j<=250:
%o A059010     if bin(i)[2:].count("0")%2==0:
%o A059010         print(str(j)+" "+str(i))
%o A059010         j+=1
%o A059010     i+=1 # _Indranil Ghosh_, Feb 03 2017
%o A059010 (R)
%o A059010 maxrow <- 4 # by choice
%o A059010 onezeros <- 1
%o A059010 for(m in 1:(maxrow+1)){
%o A059010   row <- onezeros[2^(m-1):(2^m-1)]
%o A059010   onezeros <- c(onezeros, c(1-row, row) )
%o A059010 }
%o A059010 a <- which(onezeros == 1)
%o A059010 a
%o A059010 # _Yosu Yurramendi_, Mar 28 2017
%Y A059010 Cf. A059009 (complement).
%Y A059010 Cf. A023416 (number of 0-bits), A059448 (their parity), A298952 (opposite parity).
%Y A059010 Cf.  A001969 (even 1-bits), A059012 (even both 0's and 1's), A059014 (even 0's, odd 1's).
%K A059010 nonn,easy,base,nice
%O A059010 0,2
%A A059010 _Patrick De Geest_, Dec 15 2000
%E A059010 Name clarified by _Antti Karttunen_, Mar 28 2017