A171588 The Pell word: Fixed point of the morphism 0->001, 1->0.
0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1
Offset: 1
Examples
From _Peter Bala_, Nov 22 2013: (Start) The sequence of words S(n) begins S(0) = 0 S(1) = 001 S(2) = 001 001 0 S(3) = 0010010 0010010 001 S(4) = 00100100010010001 00100100010010001 0010010. The lengths of the words are [1, 3, 7, 17, 41, ...] = A001333 (apart from the initial term). (End)
References
- J.-P. Allouche and J. Shallit, Automatic Sequences, Cambridge Univ. Press, 2003, p. 284.
Links
- Vincenzo Librandi, Table of n, a(n) for n = 1..5000
- Scott Balchin and Dan Rust, Computations for Symbolic Substitutions, Journal of Integer Sequences, Vol. 20 (2017), Article 17.4.1.
- Jean Berstel and Juhani Karhumäki, Combinatorics on words-a tutorial. Bull. Eur. Assoc. Theor. Comput. Sci. EATCS, 79:178-228, 2003.
- Michel Dekking, Substitution invariant Sturmian words and binary trees, arXiv:1705.08607 [math.CO], 2017.
- Michel Dekking, Substitution invariant Sturmian words and binary trees, Integers, Electronic Journal of Combinatorial Number Theory 18A (2018), #A17.
- Michel Dekking and Mike Keane, Two-block substitutions and morphic words, arXiv:2202.13548 [math.CO], 2022.
- M. Lothaire, Combinatorics on Words.
- Wikipedia, Sturmian word
Programs
-
Magma
[Floor((n+1)*(1-1/Sqrt(2))-Floor(n*(1-1/Sqrt(2)))): n in [1..100]]; // Vincenzo Librandi, Jan 31 2017
-
Maple
Digits := 50: u := evalf(2 + sqrt(2)): A171588 := n->floor((n+1)/u) - floor(n/u): seq(A171588(n), n = 1..80); # Peter Bala, Nov 22 2013
-
Mathematica
Table[Floor[(n + 1) (1 - 1/Sqrt[2]) - Floor[n (1 - 1/Sqrt[2])]], {n, 100}] (* Vincenzo Librandi, Jan 31 2017 *) Nest[Flatten[# /. {0 -> {0, 0, 1}, 1 -> {0}}] &, {0}, 6] (* Clark Kimberling, May 11 2017 *)
-
Python
from math import isqrt def A171588(n): return 1+isqrt(n**2>>1)-isqrt((n+1)**2>>1) # Chai Wah Wu, May 24 2025
Formula
a(n) = floor((n + 1)/(2 + sqrt(2))) - floor(n /(2 + sqrt(2))). - Peter Bala, Nov 22 2013
a(n) = floor((n+1)*(1 - 1/sqrt(2))) - floor(n*(1 - 1/sqrt(2))). - Michel Dekking, Jan 31 2017
Comments