A030300 Runs have lengths 2^n, n >= 0.
1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 1
Links
- Antti Karttunen, Table of n, a(n) for n = 1..65537
- Aubrey J. Kempner, On Transcendental Numbers, Transactions of the American Mathematical Society, volume 17, number 4, October 1916, pages 476-482.
- Kevin Ryde, Plot of A079947(n)/n, illustrating proportion of 1s in the first n terms here does not converge (but oscillates with rises and falls by hyperbolas)
- Ralf Stephan, Some divide-and-conquer sequences ...
- Ralf Stephan, Table of generating functions
- Ralf Stephan, Divide-and-conquer generating functions. I. Elementary sequences, arXiv:math/0307027 [math.CO], 2003.
- Index entries for sequences related to binary expansion of n
- Index entries for characteristic functions
Crossrefs
Programs
-
Maple
f0 := n->[seq(0,i=1..2^n)]; f1 := n->[seq(1,i=1..2^n)]; s := []; for i from 0 to 4 do s := [op(s), op(f1(2*i)), op(f0(2*i+1))]; od: A030300 := s;
-
Mathematica
nMax = 6; Table[1 - Mod[n, 2], {n, 0, nMax}, {2^n}] // Flatten (* Jean-François Alcover, Oct 20 2016 *)
-
PARI
a(n) = if(n, !(logint(n,2)%2)); /* Kevin Ryde, Aug 02 2019 */
-
Python
def A030300(n): return n.bit_length()&1 # Chai Wah Wu, Jan 30 2023
Formula
a(n) = (1/2)*(1+(-1)^floor(log_2(n))). - Benoit Cloitre, Feb 22 2003
G.f.: 1/(1-x) * Sum_{k>=0} (-1)^k*x^2^k. - Ralf Stephan, Jul 12 2003
a(n) = 1 - a(floor(n/2)). - Vladeta Jovovic, Aug 04 2003
a(n) = A115253(2n, n) mod 2. - Paul Barry, Jan 18 2006
a(n) = 1 - A030301(n). - Antti Karttunen, Oct 10 2017
Comments