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.

Showing 1-3 of 3 results.

A159684 Sturmian word: limit S(infinity) where S(0) = 0, S(1) = 0,1 and for n>=1, S(n+1) = S(n)S(n)S(n-1).

Original entry on oeis.org

0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0
Offset: 0

Views

Author

Philippe Deléham, Apr 19 2009

Keywords

Comments

Fixed point of morphism 0 -> 0,1; 1 -> 0,1,0.
This sequence corresponds to the case k = 1 of the Sturmian word S_k(infinity) as defined in A080764. See A171588 for the case k = 2. - Peter Bala, Nov 22 2013
This sequence is the {1->01}-transform of the Sturmian word A080764. - Clark Kimberling, May 17 2017
Also, sequence (1 if x/sqrt(2) is integer, 0 else) as x runs over the elements of N U N*sqrt(2) in increasing order, N = {0, 1, 2, ...}. See A144612 for the sqrt(3) analog. - M. F. Hasler, Feb 06 2025

Examples

			0 -> 0,1 -> 0,1,0,1,0 -> 0,1,0,1,0,0,1,0,1,0,0,1 ->...
		

Crossrefs

See A188037 for another version of this sequence. - N. J. A. Sloane, Mar 22 2011
The following sequences are all essentially the same, in the sense that they are simple transformations of each other, with A003151 as the parent: A003151, A001951, A001952, A003152, A006337, A080763, A082844 (conjectured), A097509, A159684, A188037, A245219 (conjectured), A276862. - N. J. A. Sloane, Mar 09 2021

Programs

  • Haskell
    a159684 n = a159684_list !! n
    a159684_list = 0 : concat (iterate (concatMap s) [1])
       where s 0 = [0,1]; s 1 = [0,1,0]
    -- Reinhard Zumkeller, Oct 26 2013
    
  • Mathematica
    Nest[ Flatten[ # /. {0 -> {0, 1}, 1 -> {0, 1, 0}}] &, {1}, 6] (* Robert G. Wilson v, May 02 2009 *)
    SubstitutionSystem[{0->{0,1},1->{0,1,0}},{1},{6}][[1]] (* Harvey P. Dale, Dec 25 2021 *)
  • Python
    def aupto(nn):
        Snm1, Sn = [0], [0, 1]
        while len(Sn) < nn+1: Snm1, Sn = Sn, Sn + Sn + Snm1
        return Sn[:nn+1]
    print(aupto(104)) # Michael S. Branicky, Jul 23 2022
    
  • Python
    from math import isqrt
    def A159684(n): return -isqrt(m:=(n+1)**2<<1)+isqrt(m+(n<<2)+6)-1 # Chai Wah Wu, Aug 03 2022

Formula

From Peter Bala, Nov 22 2013: (Start)
a(n) = floor((n + 2)*(sqrt(2) - 1)) - floor((n + 1)*(sqrt(2) - 1)).
If we read the sequence as the decimal constant C = 0.01010 01010 01010 10010 10010 ... then C = sum {n >= 1} 1/10^floor(n*(1 + sqrt(2))).
The real number 9*C has the simple continued fraction expansion [0; 11, 1010, 10000100, 100000000000100000, 100000000000000000000000000001000000000000, ...], the partial quotients having the form 10^Pell(n)*(1 + 10^Pell(n+1)) = 10^A001333(n+1) + 10^A000129(n) (see Adams and Davison).
A rapidly converging series for C is C = 9*sum {n >= 1} 10^Pell(2*n-1)*(1 + 10^Pell(2*n))/( (10^Pell(2*n-1) - 1)*(10^Pell(2*n+1) - 1) ): for example, the first 10 terms of the series give a rational approximation to C accurate to more than 130 million decimal places. Compare with the Fibonacci words A005614 and A221150. (End)

Extensions

More terms from Robert G. Wilson v, May 02 2009

A245222 Continued fraction expansion of the constant c in A245221; c = sup{f(n,1)}, where f(1,x) = x + 1 and thereafter f(n,x) = x + 1 if n is in A022838, else f(n,x) = 1/x.

Original entry on oeis.org

2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1
Offset: 0

Views

Author

Clark Kimberling, Jul 14 2014

Keywords

Comments

See Comments at A245215.
Appears to be the same as the sequence 1 + [x == 0 (mod sqrt(3))], as x runs over the elements of N U N*sqrt(3) in increasing order, where N = {0, 1, 2, 3, ...} and [...] is the Iverson bracket. - M. F. Hasler, Feb 06 2025

Examples

			c = 2.7207664507294752975469517348171513242... ; the first 12 numbers f(n,1) comprise S(12) = {1, 2, 1/2, 3/2, 2/3, 5/3, 8/3, 3/8, 11/8, 8/11, 19/11, 11/19}; max(S(12)) = 8/3, with continued fraction [2,1,2].
From _M. F. Hasler_, Feb 06 2025: (Start)
Illustration of the "multiple of sqrt(3)" comment:
  n:  0   1   2    3   4    5    6   7   8    9   10  11  12   13  14  15
  x:  0   1  1.73  2   3   3.46  4   5  5.20  6  6.93  7   8  8.66  9  10
  m:  1   0   1    0   0    1    0   0   1    0   1    0   0   1    0   0
Here, x lists the elements of N U N*sqrt(3), and m = 1 if x == 0 (mod sqrt(3)), i.e., x is an integer multiple of sqrt(3). The sequence a(n) is m + 1. (End)
		

Crossrefs

Cf. A226080 (infinite Fibonacci tree), A245217, A245219, A245220, A245221 (decimal expansion).
Cf. A144612 (Sturmian word of slope (3-sqrt(3))/2; same as 2-a(n)).
Cf. A006337 (Hofstadter's eta sequence: an analog with sqrt(2)).

Programs

  • Mathematica
    tmpRec = $RecursionLimit; $RecursionLimit = Infinity; u[x_] := u[x] = x + 1; d[x_] := d[x] = 1/x; r = Sqrt[3]; w = Table[Floor[k*r], {k, 2000}]; s[1] = 1; s[n_] := s[n] = If[MemberQ[w, n - 1], u[s[n - 1]], d[s[n - 1]]]; max = Max[N[Table[s[n], {n, 1, 3000}], 200]] (* A245221 *)
    ContinuedFraction[max, 120] (* A245222 *)
  • PARI
    /* illustration of the comment related to sqrt(3)*/
    [1+(abs(x-x\/s*s)<1e-9) | x<-Set(concat(Col([1.,s=sqrt(3)]~*[0..99])))[1..99] ] \\ M. F. Hasler, Feb 06 2025

Formula

a(n) = 2 - A144612(n) for all n > 0. - M. F. Hasler, Feb 06 2025

Extensions

Offset changed by Andrew Howroyd, Aug 08 2024

A074065 Numerators a(n) of fractions slowly converging to sqrt(3): let a(1) = 0, b(n) = n - a(n); if (a(n) + 1) / b(n) < sqrt(3), then a(n+1) = a(n) + 1, else a(n+1)= a(n).

Original entry on oeis.org

0, 1, 1, 2, 3, 3, 4, 5, 5, 6, 6, 7, 8, 8, 9, 10, 10, 11, 12, 12, 13, 13, 14, 15, 15, 16, 17, 17, 18, 19, 19, 20, 20, 21, 22, 22, 23, 24, 24, 25, 25, 26, 27, 27, 28, 29, 29, 30, 31, 31, 32, 32, 33, 34, 34, 35, 36, 36, 37, 38, 38, 39, 39, 40, 41, 41, 42, 43, 43, 44, 45, 45, 46, 46
Offset: 1

Views

Author

Robert A. Stump (bee_ess107(AT)msn.com), Sep 15 2002

Keywords

Comments

a(n) + b(n) = n and as n -> +infinity, a(n) / b(n) converges to sqrt(3). For all n, a(n) / b(n) < sqrt(3).

Examples

			a(6)= 3 so b(6) = 6 - 3 = 3. a(7) = 4 because (a(6) + 1) / b(6) = 4/3 which is < sqrt(3). So b(7) = 7 - 4 = 3. a(8) = 5 because (a(7) + 1) / b(7) = 5/3 which is < sqrt(3).
		

Crossrefs

Formula

a(1) = 0. b(n) = n - a(n). If (a(n) + 1) / b(n) < sqrt(3), then a(n+1) = a(n) + 1, else a(n+1) = a(n).
a(n) = floor(n*(3-sqrt(3))/2). - Vladeta Jovovic, Oct 04 2003
Partial sums of A144612. - R. J. Mathar, May 30 2025

Extensions

Offset corrected by Sean A. Irvine, Jan 08 2025
Showing 1-3 of 3 results.