|
|
A056832
|
|
All a(n) = 1 or 2; a(1) = 1; get next 2^k terms by repeating first 2^k terms and changing last element so sum of first 2^(k+1) terms is odd.
|
|
14
|
|
|
1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
Dekking (2016) calls this the Toeplitz sequence or period-doubling sequence. - N. J. A. Sloane, Nov 08 2016
Fixed point of the morphism 1->12 and 2->11 (1 -> 12 -> 1211 -> 12111212 -> ...). - Benoit Cloitre, May 31 2004
The squarefree part of the even part of n. - Peter Munn, Dec 03 2020
|
|
REFERENCES
|
Manfred R. Schroeder, Fractals, Chaos, Power Laws, W. H. Freeman, NY, 1991; pp. 277-279.
|
|
LINKS
|
Kostas Karamanos, From Symbolic Dynamics to a Digital Approach: Chaos and Transcendence, in: Michel Planat (ed.), Noise, Oscillators and Algebraic Randomness, Lecture Notes in Physics, Vol. 550, Springer, Berlin, Heidelberg, 2000. (Short version. See p. 359)
Eric Weisstein's World of Mathematics, Even Part.
|
|
FORMULA
|
a(1)=1, a(n) = 1 + ((Sum_{i=1..n-1} a(i)*a(n-i)) mod 2). - Benoit Cloitre, Mar 16 2004
a(n) is multiplicative with a(2^e) = 1 + (1-(-1)^e)/2, a(p^e)=1 if p > 2. - Michael Somos, Jun 18 2005
[a(2^n+1) .. a(2^(n+1)-1)] = [a(1) .. a(2^n-1)]; a(2^(n+1)) = 3 - a(2^n).
a(n*k) = (a(n) * a(k)) mod 3.
(End)
Asymptotic mean: lim_{m->oo} (1/m) * Sum__{k=1..m} a(k) = 4/3. - Amiram Eldar, Mar 09 2021
|
|
EXAMPLE
|
1 -> 1,2 -> 1,2,1,1 -> 1,2,1,1,1,2,1,2 -> 1,2,1,1,1,2,1,2,1,2,1,1,1,2,1,1.
Here we have 1 element, then 2 elements, then 4, 8, 16, etc.
|
|
MATHEMATICA
|
Nest[ Function[l, {Flatten[(l /. {1 -> {1, 2}, 2 -> {1, 1}})]}], {1}, 7] (* Robert G. Wilson v, Mar 03 2005 *)
|
|
PROG
|
(PARI) a(n)=numerator(2/n*(4^n-1)*bernfrac(2*n))%3
(PARI) a(n)=if(n<1, 0, valuation(n, 2)%2+1) /* Michael Somos, Jun 18 2005 */
(Haskell)
a056832 n = a056832_list !! (n-1)
a056832_list = 1 : f [1] where
f xs = y : f (y : xs) where
y = 1 + sum (zipWith (*) xs $ reverse xs) `mod` 2
(Python)
|
|
CROSSREFS
|
See A035263 for an equivalent version.
A059897 is used to express relationship between terms of this sequence.
|
|
KEYWORD
|
easy,nonn,nice,mult
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|