A026465 Length of n-th run of identical symbols in the Thue-Morse sequence A010060 (or A001285).
1, 2, 1, 1, 2, 2, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 2, 2, 1, 1, 2, 2, 2, 1, 1, 2, 2, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 2, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 2, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 2, 2, 1, 1, 2, 2, 2, 1, 1, 2, 2, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 2, 2, 1, 1, 2, 2, 2, 1, 1, 2, 2, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 2, 2, 1, 1
Offset: 1
Links
- N. J. A. Sloane, Table of n, a(n) for n = 1..10000
- G. Allouche, Jean-Paul Allouche and Jeffrey Shallit, Kolam indiens, dessins sur le sable aux îles Vanuatu, courbe de Sierpinski et morphismes de monoïde, Ann. Inst. Fourier (Grenoble), Vol. 56, No. 7 (2006), pp. 2115-2130.
- Jean-Paul Allouche, On the morphism 1 -> 121, 2 -> 12221, CNRS France, 2024. See pp. 1-3, 7.
- Jean-Paul Allouche, On the morphism 1 -> 121, 2 -> 12221, Preprint, 2024 [Local copy, with permission]
- Jean-Paul Allouche, Andre Arnold, Jean Berstel, Srecko Brlek, William Jockusch, Simon Plouffe and Bruce E. Sagan, A sequence related to that of Thue-Morse, Discrete Math., Vol. 139, No. 1-3 (1995), pp. 455-461.
- Claudio Bonanno, Carlo Carminati, Stefano Isola and Giulio Tiozzo, Dynamics of continued fractions and kneading sequences of unimodal maps, arXiv:1012.2131 [math.DS], 2010-2012.
- Srećko Brlek, Enumeration of factors in the Thue-Morse word, Discrete Applied Math., Vol. 24, No. 1-3 (1989), pp. 83-96.
- Julien Cassaigne, Limit values of the recurrence quotient of Sturmian sequences, Theoret. Comput. Sci., Vol. 218, No. 1 (1999), pp. 3-12.
- Artūras Dubickas, On the distance from a rational power to the nearest integer, Journal of Number Theory, Vol. 117, No. 1 (March 2006), pp. 222-239.
- Artūras Dubickas, On a sequence related to that of Thue-Morse and its applications, Discrete Math., Vol. 307, No. 9-10 (2007), pp. 1082-1093. MR2292537 (2008b:11086).
- Cor Kraaikamp, Thomas A. Schmidt and Wolfgang Steiner, Natural extensions and entropy of alpha-continued fractions, arXiv:1011.4283 [math.DS], 2010-2012.
- Claude Lenormand, Deux transformations sur les mots, Preprint, 5 pages, Nov 17 2003. Apparently unpublished. This is a scanned copy of the version that the author sent to me in 2003. - _N. J. A. Sloane_, Sep 09 2018. See page 2.
- Kevin Ryde, PARI/GP Code
- Jeffrey Shallit, Automaticity IV: Sequences, sets, and diversity, J. Théor. Nombres Bordeaux, Vol. 8, No. 2 (1996), pp. 347-367. See page 354.
Crossrefs
Programs
-
Haskell
import Data.List (group) a026465 n = a026465_list !! (n-1) a026465_list = map length $ group a010060_list -- Reinhard Zumkeller, Jul 15 2014
-
Maple
# From Carlo Carminati, Feb 25 2011: ## period-doubling routine: double:=proc(SS) NEW:=[op(S), op(S)]: if op(nops(NEW),NEW)=1 then NEW:=[seq(op(j,NEW), j=1..nops(NEW)-2),op(nops(NEW)-1,NEW)+1]: else NEW:=[seq(op(j,NEW), j=1..nops(NEW)-1),op(nops(NEW)-1,NEW)-1,1]: fi: end proc: # 10 loops of the above routine generate the first 1365 terms of the sequence # (except for the initial term): S:=[2]: for j from 1 to 10 do S:=double(S); od: S; # From N. J. A. Sloane, Dec 31 2013: S:=[b]; M:=14; for n from 1 to M do T:=subs({b=[b,a,a], a=[b]}, S); S := map(x->op(x),T); od: T:=subs({a=1,b=2},S): T:=[1,op(T)]: [seq(T[n],n=1..40)];
-
Mathematica
Length /@ Split@ Nest[ Flatten@ Join[#, # /. {1 -> 2, 2 -> 1}] &, {1}, 7] NestList[ Flatten[# /. {1 -> {2}, 2 -> {1, 1, 2}}] &, {1}, 7] // Flatten (* Robert G. Wilson v, May 20 2014 *)
-
PARI
\\ See links.
-
Python
def A026465(n): if n==1: return 1 def iterfun(f,n=0): m, k = n, f(n) while m != k: m, k = k, f(k) return m def f(x): c, s = x, bin(x)[2:] l = len(s) for i in range(l&1^1,l,2): c -= int(s[i])+int('0'+s[:i],2) return c return iterfun(lambda x:f(x)+n,n)-iterfun(lambda x:f(x)+n-1,n-1) # Chai Wah Wu, Jan 29 2025
Formula
G.f.: Product_{k>=1} (1 + x^A001045(k)). - Paul Barry, Dec 09 2004
Asymptotic mean: lim_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 3/2. - Amiram Eldar, Jan 16 2022
Extensions
Corrected and extended by John W. Layman, Feb 18 2003
Definition revised by N. J. A. Sloane, Dec 30 2013
Comments