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-7 of 7 results.

A110006 a(n) = n-F(F(n)) where F(x)=A120613(x)=floor(phi*floor(x/phi)) and phi=(1+sqrt(5))/2.

Original entry on oeis.org

1, 2, 3, 3, 2, 3, 3, 4, 3, 2, 3, 3, 2, 3, 3, 4, 3, 2, 3, 3, 4, 3, 2, 3, 3, 2, 3, 3, 4, 3, 2, 3, 3, 2, 3, 3, 4, 3, 2, 3, 3, 4, 3, 2, 3, 3, 2, 3, 3, 4, 3, 2, 3, 3, 4, 3, 2, 3, 3, 2, 3, 3, 4, 3, 2, 3, 3, 2, 3, 3, 4, 3, 2, 3, 3, 4, 3, 2, 3, 3, 2, 3, 3, 4, 3, 2, 3, 3, 2, 3, 3, 4, 3, 2, 3, 3, 4, 3, 2, 3, 3, 2, 3, 3, 4
Offset: 1

Views

Author

Benoit Cloitre, Sep 02 2005

Keywords

Comments

To built the sequence start from the infinite Fibonacci word : b(n)=floor(n/phi)-floor((n-1)/phi) for n>=1 giving 0,1,0,1,1,0,1,0,1,1,0,1,1,0,1,0,1,1,..... Then replace each 0 by the block {2,3,3} and each 1 by the block {2,3,3,4,3}. Append an initial 1.

References

  • Benoit Cloitre, On properties of irrational numbers related to the floor function, in preparation, 2005.

Crossrefs

Cf. A005614 (infinite Fibonacci binary word), A120613.
Cf. sequences for a(n) = n-F^k(n): A003842 (k=1), A110007 (k=3), A110010 (k=4), A110011 (k=5).

Programs

  • PARI
    a(n)=n-floor((1+sqrt(5))/2*floor((-1+sqrt(5))/2*floor((1+sqrt(5))/2*floor((-1+sqrt(5))/2*n))))

A110007 a(n) = n-F(F(F(n))) where F(x)=A120613(x)=floor(phi*floor(x/phi)) and phi=(1+sqrt(5))/2.

Original entry on oeis.org

1, 2, 3, 4, 4, 5, 4, 5, 5, 4, 5, 4, 4, 5, 4, 5, 5, 4, 5, 4, 5, 5, 4, 5, 4, 4, 5, 4, 5, 5, 4, 5, 4, 4, 5, 4, 5, 5, 4, 5, 4, 5, 5, 4, 5, 4, 4, 5, 4, 5, 5, 4, 5, 4, 5, 5, 4, 5, 4, 4, 5, 4, 5, 5, 4, 5, 4, 4, 5, 4, 5, 5, 4, 5, 4, 5, 5, 4, 5, 4, 4, 5, 4, 5, 5, 4, 5, 4, 4, 5, 4, 5, 5, 4, 5, 4, 5, 5, 4, 5, 4, 4, 5, 4, 5
Offset: 1

Views

Author

Benoit Cloitre, Sep 02 2005

Keywords

Comments

To build the sequence start from the infinite Fibonacci word: b(k)=floor(k/phi)-floor((k-1)/phi) for k>=1 giving 0,1,0,1,1,0,1,0,1,1,0,1,1,0,1,0,1,1,..... Then replace each 0 by the block {4,5,4} and each 1 by the block {5,5,4,5,4}. Append the initial string {1,2,3,4}.

References

  • Benoit Cloitre, On properties of irrational numbers related to the floor function, in preparation, 2005.

Crossrefs

Cf. A005614 (infinite Fibonacci binary word), A120613.
Cf. sequences for a(n) = n-F^k(n): A003842 (k=1), A110006 (k=2), A110010 (k=4), A110011 (k=5).

Programs

  • Mathematica
    Join[{1,2,3,4},Flatten[Table[Floor[k/GoldenRatio]-Floor[(k-1)/ GoldenRatio],{k,30}]/.{0->{4,5,4},1->{5,5,4,5,4}}]] (* Harvey P. Dale, Dec 12 2017 *)
  • PARI
    F(x)=floor((1+sqrt(5))/2*floor((-1+sqrt(5))/2*x))
    a(n)=n-F(F(F(n)))

A110010 a(n) = n-F(F(F(F(n)))) where F(x)=A120613(x)=floor(phi*floor(x/phi)) and phi=(1+sqrt(5))/2.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 6, 7, 6, 6, 7, 6, 5, 6, 6, 7, 6, 6, 7, 6, 7, 6, 6, 7, 6, 5, 6, 6, 7, 6, 6, 7, 6, 5, 6, 6, 7, 6, 6, 7, 6, 7, 6, 6, 7, 6, 5, 6, 6, 7, 6, 6, 7, 6, 7, 6, 6, 7, 6, 5, 6, 6, 7, 6, 6, 7, 6, 5, 6, 6, 7, 6, 6, 7, 6, 7, 6, 6, 7, 6, 5, 6, 6, 7, 6, 6, 7, 6, 5, 6, 6, 7, 6, 6, 7, 6, 7, 6, 6, 7, 6, 5, 6, 6, 7
Offset: 1

Views

Author

Benoit Cloitre, Sep 02 2005

Keywords

Comments

To built the sequence start from the infinite Fibonacci word b(k)=floor(k/phi)-floor((k-1)/phi) for k>=1 giving 0,1,0,1,1,0,1,0,1,1,0,1,1,0,1,0,1,1,..... Then replace each 0 by the block {5,6,6} and each 1 by the block {7, 6, 6, 7, 6}. Append the initial string {1,2,3,4}.

References

  • Benoit Cloitre, On properties of irrational numbers related to the floor function, in preparation, 2005.

Crossrefs

Cf. A005614 (infinite Fibonacci binary word), A120613.
Cf. sequences for a(n) = n-F^k(n): A003842 (k=1), A110006 (k=2), A110007 (k=3), A110011 (k=5).

Programs

  • PARI
    F(x)=floor((1+sqrt(5))/2*floor((-1+sqrt(5))/2*x)); a(n)=n-F(F(F(F(n))))

A110011 a(n) = n-F(F(F(F(F(n))))) = n-F^5(n) where F(x)=A120613(x)=floor(phi*floor(x/phi)) and phi=(1+sqrt(5))/2.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 8, 7, 8, 8, 7, 8, 7, 8, 8, 7, 8, 8, 9, 8, 7, 8, 8, 7, 8, 7, 8, 8, 7, 8, 8, 7, 8, 7, 8, 8, 7, 8, 8, 9, 8, 7, 8, 8, 7, 8, 7, 8, 8, 7, 8, 8, 9, 8, 7, 8, 8, 7, 8, 7, 8, 8, 7, 8, 8, 7, 8, 7, 8, 8, 7, 8, 8, 9, 8, 7, 8, 8, 7, 8, 7, 8, 8, 7, 8, 8, 7, 8, 7, 8, 8, 7, 8, 8, 9, 8, 7, 8, 8, 7, 8, 7, 8
Offset: 1

Views

Author

Benoit Cloitre, Sep 02 2005

Keywords

Comments

To built the sequence start from the infinite Fibonacci word b(k)=floor(k/phi)-floor((k-1)/phi) for k>=2 giving 1,0,1,1,0,1,0,1,1,0,1,1,0,1,0,1,1,..... Then replace each 0 by the block {9,8,7,8,8,7,8,7,8,8,7,8,8} and each 1 by the block {9,8,7,8,8,7,8,7,8,8,7,8,8,7,8,7,8,8,7,8,8}. Append the initial string {1,2,3,4,5,6,7,8,8,7,8,8,7,8,7,8,8,7,8,8}.

References

  • Benoit Cloitre, On properties of irrational numbers related to the floor function, in preparation, 2005.

Crossrefs

Cf. A005614 (infinite Fibonacci binary word), A120613.
Cf. sequences for a(n) = n-F^k(n): A003842 (k=1), A110006 (k=2), A110007 (k=3), A110010 (k=4).

Programs

  • PARI
    F(x)=floor((1+sqrt(5))/2*floor((-1+sqrt(5))/2*x)); a(n)=n-F(F(F(F(F(n)))))

A003842 The infinite Fibonacci word: start with 1, repeatedly apply the morphism 1->12, 2->1, take limit; or, start with S(0)=2, S(1)=1, and for n>1 define S(n)=S(n-1)S(n-2), then the sequence is S(oo).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Or, fixed point of the morphism 1->12, 2->1, starting from a(1) = 2.
A Sturmian word, as are all versions of this sequence. This means that if one slides a window of length n along the sequence, one sees exactly n+1 different subwords (see A213975). For a proof, see for example Chap. 2 of Lothaire (2002).
The limiting mean of the first n terms is 3 - phi, where phi is the golden ratio (A001622); the limiting variance is 2 - phi. - Clark Kimberling, Mar 12 2014
The Wikipedia article on L-system Example 1 is "Algae" given by the axiom: A and rules: A -> AB, B -> A. The sequence G(n) = G(n-1)G(n-2) yields this sequence when A -> 1, B -> 2. - Michael Somos, Jan 12 2015
In the limit #1's : #2's = phi : 1. - Frank M Jackson, Mar 12 2018

Examples

			Over the alphabet {a,b} this is the sequence a, b, a, a, b, a, b, a, a, b, a, a, b, a, b, a, a, b, a, b, a, a, b, a, a, b, a, b, a, a, b, a, a, b, a, b, a, a, b, a, b, a, a, b, a, a, b, a, b, a, a, b, a, b, a, a, b, a, a, b, a, b, a, a, b, a, a, b, a, b, a, a, b, a, b, a, a, b, a, a, b, a, b, a, a, b, a, a, b, a, b, a, a, b, a, b, a, a, b, a, a, b, a, b, a, ...
		

References

  • J.-P. Allouche and J. Shallit, Automatic Sequences, Cambridge Univ. Press, 2003.
  • Jean Berstel, "Fibonacci words—a survey." In The book of L, pp. 13-27. Springer Berlin Heidelberg, 1986.
  • J. Berstel and J. Karhumaki, Combinatorics on words - a tutorial, Bull. EATCS, #79 (2003), pp. 178-228.
  • E. Bombieri and J. Taylor, Which distribution of matter diffracts? An initial investigation, in International Workshop on Aperiodic Crystals (Les Houches, 1986), J. de Physique, Colloq. C3, 47 (1986), C3-19 to C3-28.
  • Aldo de Luca and Stefano Varricchio, Finiteness and regularity in semigroups and formal languages. Monographs in Theoretical Computer Science. An EATCS Series. Springer-Verlag, Berlin, 1999. x+240 pp. ISBN: 3-540-63771-0 MR1696498 (2000g:68001). See p. 25.
  • J. C. Lagarias, Number Theory and Dynamical Systems, pp. 35-72 of S. A. Burr, ed., The Unreasonable Effectiveness of Number Theory, Proc. Sympos. Appl. Math., 46 (1992). Amer. Math. Soc. - see p. 64.
  • G. Melançon, Factorizing infinite words using Maple, MapleTech journal, vol. 4, no. 1, 1997, pp. 34-42, esp. p. 36.

Crossrefs

A003849 is another common version of this sequence.
The following sequences are all essentially the same, in the sense that they are simple transformations of each other, with A000201 as the parent: A000201, A001030, A001468, A001950, A003622, A003842, A003849, A004641, A005614, A014675, A022342, A088462, A096270, A114986, A124841. - N. J. A. Sloane, Mar 11 2021

Programs

  • Haskell
    a003842 n = a003842_list !! n
    a003842_list = tail $ concat fws where
       fws = [2] : [1] : (zipWith (++) fws $ tail fws)
    -- Reinhard Zumkeller, Oct 26 2013
    
  • Mathematica
    Nest[ Flatten[ # /. {1 -> {1, 2}, 2 -> {1}}] &, {1}, 10] (* Robert G. Wilson v, Mar 04 2005 *)
    Table[n + 1 - Floor[((1 + Sqrt[5])/2)*Floor[2*(n + 1)/(1 + Sqrt[5])]], {n, 1, 50}] (* G. C. Greubel, May 18 2017 *)
    SubstitutionSystem[{1->{1,2},2->{1}},{1},{10}][[1]] (* Harvey P. Dale, Nov 19 2022 *)
  • PARI
    for(n=1,50, print1(n+1 - floor(((1+sqrt(5))/2)*floor(2*(n+1)/(1+sqrt(5)))), ", ")) \\ G. C. Greubel, May 18 2017
    
  • Python
    def A003842(length):
        a = [1]
        while len(a)Nicholas Stefan Georgescu, Jun 14 2022
    
  • Python
    def aupto(nn):
        S, Fnm2, Fnm1 = [1, 2], 1, 2
        while len(S) < nn+1:
            S += S[:min(Fnm2, nn+1-len(S))]
            Fnm2, Fnm1 = Fnm1, Fnm1+Fnm2
        return S
    print(aupto(104)) # Michael S. Branicky, Jun 06 2022
    
  • Python
    from math import isqrt
    def A003842(n): return n+2-((m:=(n+2+isqrt(5*(n+2)**2)>>1)-n-2)+isqrt(5*m**2)>>1) # Chai Wah Wu, Aug 26 2022

Formula

Define strings S(0)=2, S(1)=1, S(n)=S(n-1)S(n-2); iterate. Sequence is S(infinity).
a(n) = n + 2 - A120613(n+1). - Benoit Cloitre, Jul 28 2005 [Corrected by N. J. A. Sloane, Jun 30 2018]

Extensions

Entry revised by N. J. A. Sloane, Jul 03 2012

A120614 a(n) = g(n+1) - g(n) where g(k) = floor(phi*floor(k/phi)) and phi = (1+sqrt(5))/2.

Original entry on oeis.org

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

Views

Author

Benoit Cloitre, Jun 17 2006

Keywords

Comments

From Michel Dekking, Oct 29 2018: (Start)
Here is a proof that (a(n)) is fixed point of the morphism 0->102, 1->102, 2->02.
Let alpha:=phi-1. Then alpha*phi = 1. So
g(k) = floor(phi*floor(k*alpha)).
Write k*alpha = floor(k*alpha) + {k*alpha}, i.e., {k*alpha} is the fractional part of k*alpha. Then
g(k) = floor(phi*(k*alpha-{k*alpha})) = k + floor(-phi*{k*alpha}).
Thus
a(n) = n+1 +floor(-phi*{(n+1)*alpha})-n -floor(-phi*{n*alpha}).
It follows that
a(n) = 1 - floor(phi*{(n+1)*alpha}) + floor(phi*{n*alpha}).
The difference -floor(phi*{(n+1)*alpha}) + floor(phi*{n*alpha}) is equal to -1, 0 or 1, since floor(phi*{n*alpha}) is equal to 0 or 1.
In fact, phi*{n*alpha} can only take values between 0 and 1.619, and floor(phi*{n*alpha}) = 0 if and only if
{n*alpha} < 1/phi = alpha.
This is the same (putting rho:=1-alpha) as requiring
{n*alpha+rho} < 1-alpha.
Via the rotation description of Sturmian sequences (see, e.g., Lothaire), one sees that this sequence is the inhomogeneous Sturmian sequence s(alpha, rho), but with offset 1, and with 0 and 1 exchanged. Since rho+alpha=1, it follows that s(alpha, rho) with offset 2 equals s(1-alpha, 1-alpha), the classical Fibonacci sequence xF:=A003849, fixed point of 0->01, 1->0. We have found that
a(n+1)=0 iff xF(n)=0, xF(n+1)=1,
a(n+1)=1 iff xF(n)=0, xF(n+1)=0,
a(n+1)=2 iff xF(n)=1, xF(n+1)=0.
This means that (a(n+1)) equals the 3-symbol Fibonacci sequence A270788 on the alphabet {0,2,1}. Then Proposition 5 in "Morphisms, Symbolic Sequences, and Their Standard Forms" yields that (a(n)) is fixed point of the morphism 0->102, 1->102, 2->02. (End)

Crossrefs

Programs

  • Magma
    [Floor((1+Sqrt(5))*Floor(2*(k+1)/(1+Sqrt(5)))/2) -
    Floor((1+Sqrt(5))*Floor(2*k/(1+Sqrt(5)))/2): k in [1..100]]; // G. C. Greubel, Oct 23 2018
    
  • Maple
    g:=k->floor((1+sqrt(5))/2*floor(k/((1+sqrt(5))/2))): seq(g(n+1)-g(n),n=1..110); # Muniru A Asiru, Oct 21 2018
  • Mathematica
    #[[2]]-#[[1]]&/@Partition[Table[Floor[GoldenRatio*Floor[n/GoldenRatio]],{n,0,110}],2,1] (* Harvey P. Dale, Dec 14 2012 *)
  • PARI
    {phi=(1+sqrt(5))/2; g(k)=floor(phi*floor(k/phi))};
    vector(100, n, g(n+1)-g(n)) \\ G. C. Greubel, Oct 23 2018
    
  • Python
    from math import isqrt
    def A120614(n): return ((m:=(n+1+isqrt(5*(n+1)**2)>>1)-n-1)+isqrt(5*m**2)>>1)-((k:=(n+isqrt(5*n**2)>>1)-n)+isqrt(5*k**2)>>1) # Chai Wah Wu, May 22 2025

Formula

a(floor(k*phi)+k+1)=0; a(floor(k*phi)+k+2)=2, if n is not in {floor(k*phi)+k+1}U{floor(k*phi)+k+2}_{k>=1} a(n)=1.
(a(n)) is a fixed point of the morphism 02-->10202 and 102-->10210202. [Corrected by Michel Dekking, Oct 29 2018]
Fixed point of the morphism 0->102, 1->102, 2->02. - Michel Dekking, Oct 21 2018

Extensions

Initial 0 removed from data by Michel Dekking, Oct 22 2018

A120615 a(n) = Sum_{k=0..n} floor(phi*floor(k/phi)) where phi = (1+sqrt(5))/2.

Original entry on oeis.org

0, 1, 2, 5, 9, 13, 19, 25, 33, 42, 51, 62, 74, 86, 100, 114, 130, 147, 164, 183, 202, 223, 245, 267, 291, 316, 341, 368, 395, 424, 454, 484, 516, 549, 582, 617, 652, 689, 727, 765, 805, 845, 887, 930, 973, 1018, 1064, 1110, 1158, 1206, 1256, 1307, 1358, 1411
Offset: 1

Views

Author

Benoit Cloitre, Jun 17 2006

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Sum[Floor[GoldenRatio*Floor[k/GoldenRatio]],{k,0,n}],{n,54}] (* or *) Table[n(n-3)/2+Ceiling[n/GoldenRatio],{n,54}] (* James C. McMahon, Oct 07 2024 *)
  • PARI
    phi=(1+sqrt(5))/2;a(n)=n*(n-3)/2+ceil(n/phi)

Formula

a(n) = n*(n-3)/2 + ceiling(n/phi).
Showing 1-7 of 7 results.