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.

A171588 The Pell word: Fixed point of the morphism 0->001, 1->0.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

From Peter Bala, Nov 22 2013: (Start)
This is a Sturmian word: equals the limit word S(infinity) where S(0) = 0, S(1) = 001 and for n >= 1, S(n+1) = S(n)S(n)S(n-1). See the examples below.
This sequence corresponds to the case k = 2 of the Sturmian word S_k(infinity) as defined in A080764. See A159684 for the case k = 1. (End)
Characteristic word with slope 1 - 1/sqrt(2). Since the characteristic word with slope 1-theta is the mirror image of the characteristic word with slope theta, a(n)= 1 - A080764(n) for all n. - Michel Dekking, Jan 31 2017
The positions of 0 comprise A001951 (Beatty sequence for sqrt(2)); the positions of 1 comprise A001952 (Beatty sequence for 2+sqrt(2)). - Clark Kimberling, May 11 2017
This is also the fixed point of the mapping 00->0010, 01->001, 10->010, starting with 00 [Dekking and Keane, 2022]. See A289001. - N. J. A. Sloane, Mar 09 2022

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.

Crossrefs

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