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-10 of 53 results. Next

A213975 List of subwords of A003842 arranged in lexicographic order.

Original entry on oeis.org

1, 2, 11, 12, 21, 112, 121, 211, 212, 1121, 1211, 1212, 2112, 2121, 11211, 11212, 12112, 12121, 21121, 21211, 112112, 112121, 121121, 121211, 211211, 211212, 212112, 1121121, 1121211, 1211211, 1211212, 1212112, 2112112, 2112121, 2121121, 11211212, 11212112
Offset: 1

Views

Author

N. J. A. Sloane, Jul 03 2012, Jul 10 2012

Keywords

Comments

The Fibonacci word A003842 is a Sturmian word, which means that there are exactly n+1 different factors (or subwords) of length n for all n.
For another version of this sequence see the Noe link at A003849 (and included below).

Examples

			A003842 begins 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 2, ... and we can see factors 1, 2, 11, 12, 21, but not 22.
		

Crossrefs

Programs

  • Maple
    S:= proc(n) option remember;
          `if`(n<2, [2-n], [S(n-1)[], S(n-2)[]])
        end:
    T:= proc(n) local k, l, m, s;
          for k while nops(S(k))Alois P. Heinz, Jul 04 2012
  • Mathematica
    nmax = 10;
    seq[steps_] := seq[steps] = (S = SubstitutionSystem[{1 -> {1, 2}, 2 -> {1}}, {1}, steps] // Last; T[n_] := FromDigits /@ Union[Partition[S, n, 1]]; Table[T[n], {n, 1, nmax}] // Flatten);
    seq[s = 1];
    While[seq[s] != seq[s-1], s++];
    seq[s] (* Jean-François Alcover, Apr 28 2020 *)

Formula

The list S(n), say, of words of length n in this sequence can be constructed recursively as follows.
There are two words of length 1, namely S(1)={1,2}.
The n+2 words in S(n+1) are obtained from the n+1 words in S(n) thus:
if u in S(n) is the reverse of a prefix of the Fibonacci word A003842 then both u0 and u1 are in S(n+1), otherwise u in S(n) has a unique extension ux in S(n+1), where x is determined by the requirement that no right factor of ux is one of the forbidden words listed in A214216.
For example, A214216 contains both 22 and 111. So if u ends with 2 then (since 22 is forbidden), x=1 and u1 is in S(n+1), while if u ends with 11 then (since 111 is forbidden) x=2 and u2 is in S(n+1).
On the other hand, consider for example u=21121 in S(5), which is the reverse of the first 5 digits of A003842. Now both u1 and u2 are in S(6).

A378397 Rectangular array read by descending antidiagonals: (row 1) = u, and for n >= 2, (row n) = u-inverse runlength sequence of u, where u = A003842 (an infinite Fibonacci word). See Comments.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Dec 21 2024

Keywords

Comments

If u and v are sequences, both consisting of 1's and 2's, we call v an inverse runlength sequence of u if u is the runlength sequence of v. Each u has two inverse runlength sequences, one with first term 1 and the other with first term 2. Consequently, an inverse runlength array, in which each row after the first is an inverse runlength sequence of the preceding row, is determined by its first column. Generally, if the first column is periodic with fundamental period p, then the array has p distinct limiting sequences; otherwise, there is no limiting sequence; however, if a segment, of any length, occurs in a row, then it also occurs in a subsequent row. See A378282 for details and related sequences.

Examples

			The corner of the array begins:
   1  2  1  1  2  1  2  1  1  2  1  1  2  1  2  1  1  2  1  2  1
   2  1  1  2  1  2  2  1  2  2  1  2  1  1  2  1  2  2  1  2  2
   1  1  2  1  2  2  1  2  2  1  1  2  1  1  2  2  1  2  2  1  2
   1  2  1  1  2  1  1  2  2  1  2  2  1  1  2  1  2  2  1  2  1
   2  1  1  2  1  2  2  1  2  1  1  2  2  1  2  2  1  1  2  1  2
   1  1  2  1  2  2  1  2  2  1  1  2  1  1  2  1  2  2  1  1  2
   2  1  2  2  1  2  2  1  1  2  1  1  2  2  1  2  1  1  2  1  2
   1  1  2  1  1  2  2  1  2  2  1  1  2  1  2  2  1  2  1  1  2
   1  2  1  1  2  1  2  2  1  1  2  1  1  2  2  1  2  1  1  2  1
   2  1  1  2  1  2  2  1  2  2  1  1  2  1  2  2  1  2  1  1  2
   1  1  2  1  2  2  1  2  2  1  1  2  1  1  2  2  1  2  1  1  2
   1  2  1  1  2  1  1  2  2  1  2  2  1  1  2  1  2  2  1  2  1
		

Crossrefs

Programs

  • Mathematica
    invRE[seq_, k_] := Flatten[Map[ConstantArray[#[[2]], #[[1]]] &,
        Partition[Riffle[seq, {k, 2 - Mod[k + 1, 2]}, {2, -1, 2}], 2]]];
    row1 = SubstitutionSystem[{1 -> {1, 2}, 2 -> {1}}, {1}, {7}][[1]] (* A003842 *);
    rows = {row1}; col = Take[row1, 12];
    Do[AppendTo[rows, Take[invRE[Last[rows], col[[n]]], Length[row1]]], {n, 2, Length[col]}]
    rows // ColumnForm  (* array *)
    w[n_, k_] := rows[[n]][[k]]; Table[w[n - k + 1, k], {n, 12}, {k, n, 1, -1}] // Flatten (* sequence *)
    (* Peter J. C. Moses, Nov 20 2024 *)

A214317 a(n) = length-n prefix of the Fibonacci word A003842.

Original entry on oeis.org

1, 12, 121, 1211, 12112, 121121, 1211212, 12112121, 121121211, 1211212112, 12112121121, 121121211211, 1211212112112, 12112121121121, 121121211211212, 1211212112112121, 12112121121121211, 121121211211212112, 1211212112112121121, 12112121121121211212
Offset: 1

Views

Author

N. J. A. Sloane, Jul 12 2012

Keywords

Crossrefs

Programs

  • Maple
    S:= proc(n) option remember;
          `if`(n<2, [2-n], [S(n-1)[], S(n-2)[]])
        end:
    a:= proc(n) local k;
          for k while nops(S(k))Alois P. Heinz, Jul 19 2012
  • Mathematica
    S = SubstitutionSystem[{1 -> {1, 2}, 2 -> {1}}, {1}, 20];
    FromDigits[Take[#[[1]], #[[2]]]]& /@ Transpose[{S, Range[Length[S]]}] (* Jean-François Alcover, Nov 07 2020 *)

A113533 Ascending descending base exponent transform of the infinite Fibonacci word (A003842).

Original entry on oeis.org

1, 3, 6, 5, 7, 12, 10, 15, 14, 14, 23, 16, 20, 27, 21, 30, 27, 25, 40, 28, 37, 38, 32, 49, 36, 40, 53, 39, 54, 49, 43, 68, 45, 55, 66, 50, 71, 60, 56, 83, 57, 74, 75, 61, 92, 67, 73, 94, 68, 93, 84, 72, 113, 75, 94, 101, 79, 116, 89, 91, 122, 86, 115, 108, 90
Offset: 1

Views

Author

Jonathan Vos Post, Jan 13 2006

Keywords

Comments

The infinite Fibonacci word b(n) is the fixed point of the morphism 1->12, 2->1, starting from b(1) = 2. This transform a(n) of that sequence b(n) satisfies n <= a(n) <= 4*n, but that is not a tight bound.

Examples

			a(1) = A003842(1)^A003842(1) = 1^1 = 1.
a(2) = A003842(1)^A003842(2) + A003842(2)^A003842(1) = 1^2 + 2^1 = 3.
a(3) = 1^1 + 2^2 + 1^1 = 6.
a(4) = 1^1 + 2^1 + 1^2 + 1^1 = 5.
a(5) = 1^2 + 2^1 + 1^1 + 1^2 + 2^1 = 7.
a(6) = 1^1 + 2^2 + 1^1 + 1^1 + 2^2 + 1^1 = 12.
a(7) = 1^2 + 2^1 + 1^2 + 1^1 + 2^1 + 1^2 + 2^1 = 10.
a(8) = 1^1 + 2^2 + 1^1 + 1^2 + 2^1 + 1^1 + 2^2 + 1^1 = 15.
a(9) = 1^1 + 2^1 + 1^2 + 1^1 + 2^2 + 1^1 + 2^1 + 1^2 + 1^1 = 14.
a(10) = 1^2 + 2^1 + 1^1 + 1^2 + 2^1 + 1^2 + 2^1 + 1^1 + 1^2 + 2^1 = 14.
		

Crossrefs

Programs

  • Mathematica
    A003842[n_] := n + 1 - Floor[((1 + Sqrt[5])/2)*Floor[2*(n + 1)/(1 + Sqrt[5])]]; Table[Sum[A003842[k]^(A003842[n - k + 1]), {k, 1, n}], {n, 1, 50}] (* G. C. Greubel, May 18 2017 *)

Formula

a(n) = Sum_{k=1..n} A003842(k)^(A003842(n-k+1)). - G. C. Greubel, May 18 2017

Extensions

Corrected and extended by Giovanni Resta, Jun 13 2016

A214217 List of singular subwords (or factors) of the Fibonacci word A003842.

Original entry on oeis.org

2, 11, 212, 11211, 21211212, 1121121211211, 212112121121121211212, 1121121211211212112121121121211211, 2121121211211212112121121121211211212112121121121211212, 11211212112112121121211211212112112121121211211212112121121121211211212112121121121211211
Offset: 1

Views

Author

N. J. A. Sloane, Jul 10 2012

Keywords

Comments

Complementing the first and last digits of each term gives (essentially) A214216.

Crossrefs

Programs

  • Mathematica
    nxt[{a_,b_,c_}]:={b,c,FromDigits[Join[Flatten[IntegerDigits/@{b,a,b}]]]}; NestList[nxt,{2,11,212},10][[All,1]] (* Harvey P. Dale, May 24 2018 *)

Formula

a(0)=2, a(1)=11, a(2)=212; thereafter a(n)=the concatenation of a(n-2), a(n-3), and a(n-2). [clarified by Harvey P. Dale, May 24 2018]

A342959 Number of 1's within a sample word of length 10^n of the infinite Fibonacci word A003842 where n is the sequence index.

Original entry on oeis.org

1, 6, 62, 618, 6180, 61804, 618034, 6180340, 61803399, 618033989, 6180339888, 61803398875, 618033988750, 6180339887499, 61803398874990, 618033988749895, 6180339887498949, 61803398874989485, 618033988749894848, 6180339887498948482, 61803398874989484821
Offset: 0

Views

Author

Frank M Jackson, Mar 31 2021

Keywords

Comments

The proportion of 1's within the sample word length tends to 1/phi = 0.6180339887... (A094214) as the sample size increases to infinity.

Examples

			a(1) = 6 because the first sample of the infinite Fibonacci word has a word length of 10. The word sample is (1, 2, 1, 1, 2, 1, 2, 1, 1, 2) and #1's = 6.
		

Crossrefs

Programs

  • Mathematica
    set=Nest[Flatten[# /. {1 -> {1, 2}, 2 -> {1}}] &, {1}, 40]; Table[First@Counts@set[[1;;10^n]], {n, 1, 8}]
  • PARI
    See Links section.
    
  • PARI
    my(s=quadgen(5)-1); a(n) = floor((10^n+1)*s); \\ Kevin Ryde, Apr 09 2021
    
  • Python
    from math import isqrt
    def A342959(n): return ((m:=10**n+1)+isqrt(5*m**2)>>1)-m # Chai Wah Wu, Aug 09 2022

Formula

a(n) = A005206(10^n). - Rémy Sigrist, Apr 05 2021

Extensions

a(0) = 1 prepended and more terms from Rémy Sigrist, Apr 05 2021

A074983 Successive factors of the Fibonacci word A003842.

Original entry on oeis.org

12, 11212, 1121121211212, 1121121211211212112121121121211212, 11211212112112121121211211212112112121121211211212112121121121211211212112121121121211212
Offset: 1

Views

Author

N. J. A. Sloane, Mar 28 2003

Keywords

Comments

a(6) is 233 digits long. - Sean A. Irvine, Oct 31 2011

References

  • G. Melançon, Lyndon factorization of infinite words, STACS 96 (Grenoble, 1996), 147-154, Lecture Notes in Comput. Sci., 1046, Springer, Berlin, 1996. Math. Rev. 98h:68188.

Formula

Let b(1)=112, b(2)=12, a(1)=12. If a(n)=c(1)c(2)...c(m), then a(n+1)=b(c(1))b(c(2))...b(c(m)), where c(i) is the i-th digit of a(n). - Sean A. Irvine, Oct 31 2011

Extensions

More terms from Sean A. Irvine, Oct 30 2011

A108282 a(n) = k*a(n-1) + a(n-2) where k = A003842(a); a(0) = 1.

Original entry on oeis.org

1, 2, 3, 5, 13, 18, 49, 67, 116, 299, 415, 714, 1843, 2557, 6957, 9514, 16471, 42456, 58927, 160310, 219237, 379547, 978331, 1357878, 2336209, 6030296, 8366505, 22763306, 31129811, 53893117, 138916045, 192809162, 331725207, 856259576
Offset: 0

Views

Author

Gary W. Adamson, May 30 2005

Keywords

Comments

Aperiodic recursive rabbit sequence.
The recursive Fibonacci-like multiplier k is derived from the rabbit sequence (1 0 1 1 0 1 0 1...) in which the 0's are replaced by 2's, getting the rabbit sequence of A003842: (1 2 1 1 2 1 2 1...).

Examples

			a(6) = 49 = 2*18 + 13; where 2 = A003842(6)
		

Crossrefs

Cf. A003842.

Extensions

Corrected and extended by T. D. Noe, Nov 02 2006

A214211 Doubled Fibonacci word: the A003842 sequence replacing 1 with 1,1 and 2 with 2,2.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Jul 10 2012

Keywords

Comments

Suggested by reading Mignosi et al. (2002).

Crossrefs

A264119 Look and say for Fibonacci word A003842.

Original entry on oeis.org

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

Views

Author

Michel Marcus, Apr 03 2016

Keywords

Comments

Define strings S(0)=2, S(1)=1, S(n)=S(n-1)S(n-2); iterate.
A003842 is S(infinity) and begins 1, 2, 1, 1, 2, 1, 2.
We see one 1, one 2, two 1, one 2, one 1, one 2.
So this sequences begins 1,1, 1,2, 2,1, 1,2, 1,1, 1,2.

Crossrefs

Cf. A003842.

Programs

  • PARI
    lns(v) = {vls = []; nb = 0; old = -1; for (k=1, #v, if (v[k] == old, nb++, if (old != -1, vls = concat(vls, nb); vls = concat(vls, old);); nb = 1;); old = v[k];); vls = concat(vls, nb); vls = concat(vls, old); vls;}
    lista(nn=11) = {v = [2]; w = [1]; for (k=1, nn, nw = concat(w, v); v = w; w = nw;); lns(w);}
Showing 1-10 of 53 results. Next