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.

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.

This page as a plain text file.
%I A056832 #73 Feb 16 2025 08:32:43
%S A056832 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,
%T A056832 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,
%U A056832 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
%N 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.
%C A056832 Dekking (2016) calls this the Toeplitz sequence or period-doubling sequence. - _N. J. A. Sloane_, Nov 08 2016
%C A056832 Fixed point of the morphism 1->12 and 2->11 (1 -> 12 -> 1211 -> 12111212 -> ...). - _Benoit Cloitre_, May 31 2004
%C A056832 a(n) is multiplicative. - _Christian G. Bower_, Jun 03 2005
%C A056832 a(n) is the least k such that A010060(n-1+k) = 1 - A010060(n-1); the sequence {a(n+1)-1} is the characteristic sequence for A079523. - _Vladimir Shevelev_, Jun 22 2009
%C A056832 The squarefree part of the even part of n. - _Peter Munn_, Dec 03 2020
%D A056832 Manfred R. Schroeder, Fractals, Chaos, Power Laws, W. H. Freeman, NY, 1991; pp. 277-279.
%H A056832 Reinhard Zumkeller, <a href="/A056832/b056832.txt">Table of n, a(n) for n = 1..10000</a>
%H A056832 F. Michel Dekking, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL19/Dekking/dekk4.html">Morphisms, Symbolic Sequences, and Their Standard Forms</a>, Journal of Integer Sequences, Vol. 19 (2016), Article 16.1.1.
%H A056832 A. Hof, O. Knill and B. Simon, <a href="http://projecteuclid.org/euclid.cmp/1104275098">Singular continuous spectrum for palindromic Schroedinger operators</a>, Commun. Math. Phys. 174 (1995), 149-159.
%H A056832 Kostas Karamanos, <a href="https://doi.org/10.1007/3-540-45463-2_18">From Symbolic Dynamics to a Digital Approach: Chaos and Transcendence</a>, in: Michel Planat (ed.), Noise, Oscillators and Algebraic Randomness, Lecture Notes in Physics, Vol. 550, Springer, Berlin, Heidelberg, 2000. (Short version. See p. 359)
%H A056832 Kostas Karamanos, <a href="https://doi.org/10.1142/S0218127401002924">From symbolic dynamics to a digital approach</a>, International Journal of Bifurcation and Chaos, Vol. 11, No. 6 (2001), pp. 1683-1694. (Full version. See p. 1685)
%H A056832 Manfred R. Schroeder, <a href="/A056832/a056832.pdf">Letter to N. J. A. Sloane, May 05 1994</a>.
%H A056832 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/EvenPart.html">Even Part</a>.
%H A056832 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/SquarefreePart.html">Squarefree Part</a>.
%H A056832 <a href="/index/Fi#FIXEDPOINTS">Index entries for sequences that are fixed points of mappings</a>
%F A056832 a(n) = ((-1)^(n+1)*A002425(n)) modulo 3. - _Benoit Cloitre_, Dec 30 2003
%F A056832 a(1)=1, a(n) = 1 + ((Sum_{i=1..n-1} a(i)*a(n-i)) mod 2). - _Benoit Cloitre_, Mar 16 2004
%F A056832 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
%F A056832 [a(2^n+1) .. a(2^(n+1)-1)] = [a(1) .. a(2^n-1)]; a(2^(n+1)) = 3 - a(2^n).
%F A056832 For n > 0, a(n) = 2 - A035263(n). - _Benoit Cloitre_, Nov 24 2002
%F A056832 a(n)=2 if n-1 is in A079523; a(n)=1 otherwise. - _Vladimir Shevelev_, Jun 22 2009
%F A056832 a(n) = A096268(n-1) + 1. - _Reinhard Zumkeller_, Jul 29 2014
%F A056832 From _Peter Munn_, Dec 03 2020: (Start)
%F A056832 a(n) = A007913(A006519(n)) = A006519(n)/A234957(n).
%F A056832 a(n) = A059895(n, 2) = n/A214682(n).
%F A056832 a(n*k) = (a(n) * a(k)) mod 3.
%F A056832 a(A059897(n, k)) = A059897(a(n), a(k)).
%F A056832 (End)
%F A056832 Asymptotic mean: lim_{m->oo} (1/m) * Sum__{k=1..m} a(k) = 4/3. - _Amiram Eldar_, Mar 09 2021
%e A056832 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.
%e A056832 Here we have 1 element, then 2 elements, then 4, 8, 16, etc.
%t A056832 Nest[ Function[l, {Flatten[(l /. {1 -> {1, 2}, 2 -> {1, 1}})]}], {1}, 7] (* _Robert G. Wilson v_, Mar 03 2005 *)
%t A056832 Table[Mod[-(-1)^(n + 1) (-1)^n Numerator[EulerE[2 n + 1, 1]], 3] , {n, 0, 120}] (* _Michael De Vlieger_, Aug 15 2016, after _Jean-François Alcover_ at A002425 *)
%o A056832 (PARI) a(n)=numerator(2/n*(4^n-1)*bernfrac(2*n))%3
%o A056832 (PARI) a(n)=if(n<1, 0, valuation(n,2)%2+1) /* _Michael Somos_, Jun 18 2005 */
%o A056832 (Haskell)
%o A056832 a056832 n = a056832_list !! (n-1)
%o A056832 a056832_list = 1 : f [1] where
%o A056832    f xs = y : f (y : xs) where
%o A056832           y = 1 + sum (zipWith (*) xs $ reverse xs) `mod` 2
%o A056832 -- _Reinhard Zumkeller_, Jul 29 2014
%o A056832 (Python)
%o A056832 def A056832(n): return 1+((~n&n-1).bit_length()&1) # _Chai Wah Wu_, Jan 09 2023
%Y A056832 Cf. A197911 (partial sums).
%Y A056832 Essentially same as first differences of Thue-Morse, A010060. - _N. J. A. Sloane_, Jul 02 2015
%Y A056832 See A035263 for an equivalent version.
%Y A056832 Limit of A317956(n) for large n.
%Y A056832 Row/column 2 of A059895.
%Y A056832 Positions of 1s: A003159.
%Y A056832 Positions of 2s: A036554.
%Y A056832 A002425, A006519, A079523, A096268, A214682, A234957 are used in a formula defining this sequence.
%Y A056832 A059897 is used to express relationship between terms of this sequence.
%K A056832 easy,nonn,nice,mult
%O A056832 1,2
%A A056832 _Jonas Wallgren_, Aug 30 2000