|
|
A096268
|
|
Period-doubling sequence (or period-doubling word): fixed point of the morphism 0 -> 01, 1 -> 00.
|
|
37
|
|
|
0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,1
|
|
COMMENTS
|
Take highest power of 2 dividing n (A007814(n+1)), read modulo 2.
For the scale-invariance properties see Hendriks et al., 2012.
This is the sequence that results from the ternary Thue-Morse sequence (A036577) if all twos in that sequence are replaced by zeros. - Nathan Fox, Mar 12 2013
This sequence can be used to draw the Von Koch snowflake with a suitable walk in the plane. Start from the origin then the n-th step is "turn +Pi/3 if a(n)=0 and turn -2*Pi/3 if a(n)=1" (see link for a plot of the first 200000 steps). - Benoit Cloitre, Nov 10 2013
1 iff the number of trailing zeros in the binary representation of n+1 is odd. - Ralf Stephan, Nov 11 2013
Equivalently, with offset 1, the characteristic function of A036554 and an indicator for the A003159/A036554 classification of positive integers. - Peter Munn, Jun 02 2020
|
|
REFERENCES
|
Michel Rigo, Formal Languages, Automata and Numeration Systems, 2 vols., Wiley, 2014. Mentions this sequence - see "List of Sequences" in Vol. 2.
|
|
LINKS
|
|
|
FORMULA
|
Recurrence: a(2*n) = 0, a(4*n+1) = 1, a(4*n+3) = a(n). - Ralf Stephan, Dec 11 2004
The recurrence may be extended backwards, with a(-1) = 1. - S. I. Ben-Abraham, Apr 01 2013
Dirichlet g.f.: zeta(s)/(1+2^s). - Ralf Stephan, Jun 17 2007
Let T(x) be the g.f., then T(x) + T(x^2) = x^2/(1-x^2). - Joerg Arndt, May 11 2010
Let 2^k||n+1. Then a(n)=1 if k is odd, a(n)=0 if k is even. - Vladimir Shevelev, Aug 25 2010
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 1/3. = Amiram Eldar, Sep 18 2022
|
|
EXAMPLE
|
Start: 0
Rules:
0 --> 01
1 --> 00
-------------
0: (#=1)
0
1: (#=2)
01
2: (#=4)
0100
3: (#=8)
01000101
4: (#=16)
0100010101000100
5: (#=32)
01000101010001000100010101000101
6: (#=64)
0100010101000100010001010100010101000101010001000100010101000100
7: (#=128)
010001010100010001000101010001010100010101000100010001010100010001000101010...
|
|
MAPLE
|
nmax:=104: for p from 0 to ceil(simplify(log[2](nmax))) do for n from 0 to ceil(nmax/(p+2))+1 do a((2*n+1)*2^p-1) := p mod 2 od: od: seq(a(n), n=0..nmax); # Johannes W. Meijer, Feb 02 2013
# second Maple program:
a:= proc(n) a(n):= `if`(n::even, 0, 1-a((n-1)/2)) end:
|
|
MATHEMATICA
|
Nest[ Flatten[ # /. {0 -> {1, 0}, 1 -> {0, 0}}] &, {1}, 7] (* Robert G. Wilson v, Mar 05 2005 *)
{{0}}~Join~SubstitutionSystem[{0 -> {0, 1}, 1 -> {0, 0}}, {1}, 6] // Flatten (* Michael De Vlieger, Aug 15 2016, Version 10.2 *)
|
|
PROG
|
(PARI) a(n)=valuation(n+1, 2)%2 \\ Ralf Stephan, Nov 11 2013
(Haskell)
a096268 = (subtract 1) . a056832 . (+ 1)
(Python)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|