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.

Previous Showing 11-20 of 88 results. Next

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

A022342 Integers with "even" Zeckendorf expansions (do not end with ...+F_2 = ...+1) (the Fibonacci-even numbers); also, apart from first term, a(n) = Fibonacci successor to n-1.

Original entry on oeis.org

0, 2, 3, 5, 7, 8, 10, 11, 13, 15, 16, 18, 20, 21, 23, 24, 26, 28, 29, 31, 32, 34, 36, 37, 39, 41, 42, 44, 45, 47, 49, 50, 52, 54, 55, 57, 58, 60, 62, 63, 65, 66, 68, 70, 71, 73, 75, 76, 78, 79, 81, 83, 84, 86, 87, 89, 91, 92, 94, 96, 97, 99, 100, 102, 104, 105, 107
Offset: 1

Views

Author

Keywords

Comments

The Zeckendorf expansion of n is obtained by repeatedly subtracting the largest Fibonacci number you can until nothing remains; for example, 100 = 89 + 8 + 3.
The Fibonacci successor to n is found by replacing each F_i in the Zeckendorf expansion by F_{i+1}; for example, the successor to 100 is 144 + 13 + 5 = 162.
If k appears, k + (rank of k) does not (10 is the 7th term in the sequence but 10 + 7 = 17 is not a term of the sequence). - Benoit Cloitre, Jun 18 2002
From Michele Dondi (bik.mido(AT)tiscalenet.it), Dec 30 2001: (Start)
a(n) = Sum_{k in A_n} F_{k+1}, where a(n)= Sum_{k in A_n} F_k is the (unique) expression of n as a sum of "noncontiguous" Fibonacci numbers (with index >= 2).
a(10^n) gives the first few digits of g = (sqrt(5)+1)/2.
The sequences given by b(n+1) = a(b(n)) obey the general recursion law of Fibonacci numbers. In particular the (sub)sequence (of a(-)) yielded by a starting value of 2=a(1), is the sequence of Fibonacci numbers >= 2. Starting points of all such subsequences are given by A035336.
a(n) = floor(phi*n+1/phi); phi = (sqrt(5)+1)/2. a(F_n)=F_{n+1} if F_n is the n-th Fibonacci number.
(End)
From Amiram Eldar, Sep 03 2022: (Start)
Numbers with an even number of trailing 1's in their dual Zeckendorf representation (A104326), i.e., numbers k such that A356749(k) is even.
The asymptotic density of this sequence is 1/phi (A094214). (End)

Examples

			The successors to 1, 2, 3, 4=3+1 are 2, 3, 5, 7=5+2.
		

References

  • R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics. Addison-Wesley, Reading, MA, 1990, p. 307-308 of 2nd edition.
  • E. Zeckendorf, Représentation des nombres naturels par une somme des nombres de Fibonacci ou de nombres de Lucas, Bull. Soc. Roy. Sci. Liège 41, 179-182, 1972.

Crossrefs

Positions of 0's in A003849.
Complement of A003622.
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
    a022342 n = a022342_list !! (n-1)
    a022342_list = filter ((notElem 1) . a035516_row) [0..]
    -- Reinhard Zumkeller, Mar 10 2013
    
  • Magma
    [Floor(n*(Sqrt(5)+1)/2)-1: n in [1..100]]; // Vincenzo Librandi, Feb 16 2015
    
  • Maple
    A022342 := proc(n)
          local g;
          g := (1+sqrt(5))/2 ;
        floor(n*g)-1 ;
    end proc: # R. J. Mathar, Aug 04 2013
  • Mathematica
    With[{t=GoldenRatio^2},Table[Floor[n*t]-n-1,{n,70}]] (* Harvey P. Dale, Aug 08 2012 *)
  • PARI
    a(n)=floor(n*(sqrt(5)+1)/2)-1
    
  • PARI
    a(n)=(sqrtint(5*n^2)+n-2)\2 \\ Charles R Greathouse IV, Feb 27 2014
    
  • Python
    from math import isqrt
    def A022342(n): return (n+isqrt(5*n**2)>>1)-1 # Chai Wah Wu, Aug 17 2022

Formula

a(n) = floor(n*phi^2) - n - 1 = floor(n*phi) - 1 = A000201(n) - 1, where phi is the golden ratio.
a(n) = A003622(n) - n. - Philippe Deléham, May 03 2004
a(n+1) = A022290(2*A003714(n)). - R. J. Mathar, Jan 31 2015
For n > 1: A035612(a(n)) > 1. - Reinhard Zumkeller, Feb 03 2015
a(n) = A000201(n) - 1. First differences are given in A014675 (or A001468, ignoring its first term). - M. F. Hasler, Oct 13 2017
a(n) = a(n-1) + 1 + A005614(n-2) for n > 1; also a(n) = a(n-1) + A014675(n-2) = a(n-1) + A001468(n-1). - A.H.M. Smeets, Apr 26 2024

Extensions

Name edited by Peter Munn, Dec 07 2021

A014675 The infinite Fibonacci word (start with 1, apply 1->2, 2->21, take limit).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

The limiting mean and variance of the first n terms are both equal to the golden ratio (A001622). - Clark Kimberling, Mar 12 2014
Let F = A000045 (Fibonacci numbers). For n >= 3, the first F(n)-2 terms of A014675 form a palindrome; see A001911. If k is not one of the numbers F(n)-2, then the first k terms of A014675 do not form a palindrome. - Clark Kimberling, Jul 14 2014
First differences of A000201. - Tom Edgar, Apr 23 2015 [Editor's note: except for the offset: as for A022342, below. - M. F. Hasler, Oct 13 2017]
Also first differences of A022342 (which starts at offset 1): a(n)=A022342(n+2)-A022342(n+1), n >= 0. Equal to A001468 without its first term: a(n) = A001468(n+1), n >= 0. - M. F. Hasler, Oct 13 2017
The word is a concatenation of three runs: 1, 2, and 22. The limiting proportions of these are respectively 1/2, 1 - phi/2, and (phi - 1)/2, where phi = golden ratio. The mean runlength is (phi + 1)/2. - Clark Kimberling, Dec 26 2010

References

  • D. Gault and M. Clint, "Curiouser and curiouser" said Alice. Further reflections on an interesting recursive function, Internat. J. Computer Math., 26 (1988), 35-43. See Table 2.
  • D. E. Knuth, The Art of Computer Programming, Vol. 4A, Section 7, p. 36.
  • G. Melançon, Factorizing infinite words using Maple, MapleTech journal, vol. 4, no. 1, 1997, pp. 34-42, esp. p. 36.

Crossrefs

This is the {2,1} version. The standard form is A003849 (alphabet {0,1}). See also A005614 (alphabet {1,0}), A003842 (alphabet {1,2} instead of {2,1}).
Equals A001468 except for initial term.
Differs from A025143 in many entries starting at entry 8.
First differences of A000201 and of A022342.
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

  • Maple
    Digits := 50: t := evalf( (1+sqrt(5))/2); A014675 := n->floor((n+2)*t)-floor((n+1)*t);
  • Mathematica
    Nest[ Flatten[ # /. {1 -> 2, 2 -> {2, 1}}] &, {1}, 11] (* Robert G. Wilson v *)
    SubstitutionSystem[{1->{2},2->{2,1}},{1},{11}][[1]] (* Harvey P. Dale, Jan 01 2023 *)
  • PARI
    first(n)=my(v=[1],u); while(#vCharles R Greathouse IV, Jun 21 2017
    
  • PARI
    apply( {A014675(n,r=quadgen(5)-1)=(n+2)\r-(n+1)\r}, [0..99]) \\ M. F. Hasler, Apr 07 2021, improved on suggestion from Kevin Ryde, Apr 23 2021
    
  • Python
    from math import isqrt
    def A014675(n): return (n+2+isqrt(m:=5*(n+2)**2)>>1)-(n+1+isqrt(m-10*n-15)>>1) # Chai Wah Wu, Aug 10 2022

Formula

Define strings S(0)=1, S(1)=2, S(n)=S(n-1).S(n-2) for n>=2. Sequence is S(infinity).
a(n) = floor((n+2)*phi) - floor((n+1)*phi) = A000201(n+2) - A000201(n+1), phi = (1 + sqrt(5))/2.

Extensions

Corrected by N. J. A. Sloane, Nov 07 2001

A038580 Primes with indices that are primes with prime indices.

Original entry on oeis.org

5, 11, 31, 59, 127, 179, 277, 331, 431, 599, 709, 919, 1063, 1153, 1297, 1523, 1787, 1847, 2221, 2381, 2477, 2749, 3001, 3259, 3637, 3943, 4091, 4273, 4397, 4549, 5381, 5623, 5869, 6113, 6661, 6823, 7193, 7607, 7841, 8221, 8527, 8719, 9319, 9461, 9739
Offset: 1

Views

Author

Keywords

Crossrefs

Primes p for which A049076(p) > 3.
Second differences give A245175.
Let A = primes A000040, B = nonprimes A018252. The 2-level compounds are AA = A006450, AB = A007821, BA = A078782, BB = A102615. The 3-level compounds AAA, AAB, ..., BBB are A038580, A049078, A270792, A102617, A270794, A270795, A270796, A102616.

Programs

  • Magma
    [NthPrime(NthPrime(NthPrime(n))): n in [1..50]]; // Vincenzo Librandi, Jul 17 2016
  • Maple
    a:= ithprime@@3;
    seq(a(n), n=1..50);  # Alois P. Heinz, Jun 14 2015
    # For Maple code for the prime/nonprime compound sequences (listed in cross-references) see A003622. - N. J. A. Sloane, Mar 30 2016
  • Mathematica
    Table[ Prime[ Prime[ Prime[ n ] ] ], {n, 1, 60} ]
    Nest[Prime, Range[45], 3] (* Robert G. Wilson v, Mar 15 2004 *)
  • PARI
    a(n) = prime(prime(prime(n))) \\ Charles R Greathouse IV, Apr 28 2015
    
  • PARI
    list(lim)=my(v=List(),q,r); forprime(p=2,lim, if(isprime(q++) && isprime(r++), listput(v,p))); Set(v) \\ Charles R Greathouse IV, Feb 14 2017
    

Formula

a(n) = prime(prime(prime(n))).
a(n) ~ n*log(n)^3. - Ilya Gutkovskiy, Jul 17 2016

A035336 a(n) = 2*floor(n*phi) + n - 1, where phi = (1+sqrt(5))/2.

Original entry on oeis.org

2, 7, 10, 15, 20, 23, 28, 31, 36, 41, 44, 49, 54, 57, 62, 65, 70, 75, 78, 83, 86, 91, 96, 99, 104, 109, 112, 117, 120, 125, 130, 133, 138, 143, 146, 151, 154, 159, 164, 167, 172, 175, 180, 185, 188, 193, 198, 201, 206, 209, 214, 219, 222, 227, 230, 235, 240
Offset: 1

Views

Author

Keywords

Comments

Second column of Wythoff array.
These are the numbers in A022342 that are not images of another value of the same sequence if it is given offset 0. - Michele Dondi (bik.mido(AT)tiscalenet.it), Dec 30 2001
Also, positions of 2's in A139764, the smallest term in Zeckendorf representation of n. - John W. Layman, Aug 25 2011
From Amiram Eldar, Mar 21 2022: (Start)
Numbers k for which the Zeckendorf representation A014417(k) ends with 0, 1, 0.
The asymptotic density of this sequence is sqrt(5)-2. (End)

Crossrefs

Let A = A000201, B = A001950. Then AA = A003622, AB = A003623, BA = A035336, BB = A101864.

Programs

  • Haskell
    import Data.List (elemIndices)
    a035336 n = a035336_list !! (n-1)
    a035336_list = elemIndices 0 a005713_list
    -- Reinhard Zumkeller, Dec 30 2011
    
  • Magma
    [2*Floor(n*(1+Sqrt(5))/2)+n-1: n in [1..80]]; // Vincenzo Librandi, Nov 19 2016
    
  • Maple
    Digits := 100: t := (1+sqrt(5))/2; [ seq(2*floor((n+1)*t)+n,n=0..80) ];
  • Mathematica
    Table[2*Floor[n*(1 + Sqrt[5])/2] + n - 1, {n, 50}] (* Wesley Ivan Hurt, Nov 21 2017 *)
    Array[2 Floor[# GoldenRatio] + # - 1 &, 60] (* Robert G. Wilson v, Dec 12 2017 *)
  • Python
    from sympy import floor
    from mpmath import phi
    def a(n): return 2*floor(n*phi) + n - 1 # Indranil Ghosh, Jun 10 2017
    
  • Python
    from math import isqrt
    def A035336(n): return (n+isqrt(5*n**2)&-2)+n-1 # Chai Wah Wu, Aug 17 2022

Formula

a(n) = B(A(n)), with A(k)=A000201(k) and B(k)=A001950(k) (Wythoff BA-numbers).
a(n) = A(n) + A(A(n)), with A(A(n))=A003622(n) (Wythoff AA-numbers).
Equals A022342(A003622(n)+1). - Michele Dondi (bik.mido(AT)tiscalenet.it), Dec 30 2001, sequence reference updated by Peter Munn, Nov 23 2017
a(n) = 2*A003622(n) - (n - 1) = A003623(n) - 1. - Franklin T. Adams-Watters, Jun 30 2009
A005713(a(n)) = 0. - Reinhard Zumkeller, Dec 30 2011
a(n) = A089910(n) - 2. - Bob Selcoe, Sep 21 2014

A096270 Fixed point of the morphism 0->01, 1->011.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Jun 22 2004

Keywords

Comments

This is another version of the Fibonacci word A005614.
(With offset 1) for k>0, a(ceiling(k*phi^2))=0 and a(floor(k*phi^2))=1 where phi=(1+sqrt(5))/2 is the Golden ratio. - Benoit Cloitre, Apr 01 2006
(With offset 1) for n>1 a(A000045(n)) = (1-(-1)^n)/2.
Equals the Fibonacci word A005614 with an initial zero.
Also the Sturmian word of slope phi (cf. A144595). - N. J. A. Sloane, Jan 13 2009
More precisely: (a(n)) is the inhomogeneous Sturmian word of slope phi-1 and intercept 0: a(n) = floor((n+1)*(phi-1)) - floor(n*(phi-1)), n >= 0. - Michel Dekking, May 21 2018
The ratio of number of 1's to number of 0's tends to the golden ratio (1+sqrt(5))/2 = 1.618... - Zak Seidov, Feb 15 2012

References

  • J.-P. Allouche and J. Shallit, Automatic Sequences, Cambridge Univ. Press, 2003.

Crossrefs

Cf. A003849, A096268, A001519. See A005614, A114986 for other versions.
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

  • Magma
    [-1+Floor(n*(1+Sqrt(5))/2)-Floor((n-1)*(1+Sqrt(5))/2): n in [1..100]]; // Wesley Ivan Hurt, Aug 29 2022
  • Mathematica
    Nest[ Function[l, {Flatten[(l /. {0 -> {0, 1}, 1 -> {0, 1, 1}})]}], {0}, 6] (* Robert G. Wilson v, Feb 04 2005 *)
  • PARI
    a(n)=-1+floor(n*(1+sqrt(5))/2)-floor((n-1)*(1+sqrt(5))/2) \\ Benoit Cloitre, Apr 01 2006
    
  • Python
    from math import isqrt
    def A096270(n): return (n+1+isqrt(5*(n+1)**2)>>1)-(n+isqrt(5*n**2)>>1)>>1 # Chai Wah Wu, Aug 29 2022
    

Formula

Conjecture: a(n) is given recursively by a(1)=0 and, for n>1, by a(n)=1 if n=F(2k+1) and a(n)=a(n-F(2k+1)) otherwise, where F(2k+1) is the largest odd-indexed Fibonacci number smaller than or equal to n. (This has been confirmed for more than nine million terms.) The odd-indexed bisection of the Fibonacci numbers (A001519) is {1, 2, 5, 13, 34, 89, ...}. So by the conjecture, we would expect that a(30) = a(30-13) = a(17) = a(17-13) = a(4) = a(4-2) = a(2) = 1, which is in fact correct. - John W. Layman, Jun 29 2004
From Michel Dekking, Apr 13 2016: (Start)
Proof of the above conjecture:
Let g be the morphism above: g(0)=01, g(1)=011. Then g^n(0) has length F(2n+1), and (a(n)) starts with g^n(0) for all n>0. Obviously g^n(0) ends in 1 for all n, proving the first part of the conjecture.
We extend the semigroup of words with letters 0 and 1 to the free group, adding the inverses 0*:=0^{-1} and 1*:=1^{-1}. Easy observation: for any word w one has g(w1)= g(w0)1. We claim that for all n>1 one has g^n(0)=u(n)v(n)v(n)0*1, where u(n)=g(u(n-1))0 and v(n)=0*g(v(n-1))0. The recursion starts with u(2)=0, v(2)=10. Indeed: g^2(0)=01011=u(2)v(2)v(2)0*1. Induction step:
g^{n+1}(0)=g(g^n(0))= g(u(n)v(n)v(n)0*1)= g(u(n)v(n)v(n))1= g(u(n))00*g(v(n))00*g(v(n))00*1=u(n+1)v(n+1)v(n+1)0*1.
Since v(n) has length F(2n-1), which is the largest odd-indexed Fibonacci number smaller than or equal to m for all m between F(2n-1) and F(2n+1), the claim proves the second part of the conjecture. (End)
(With offset 1) a(n) = -1 + floor(n*phi) - floor((n-1)*phi) where phi=(1+sqrt(5))/2 so a(n) = -1 + A082389(n). - Benoit Cloitre, Apr 01 2006

Extensions

More terms from John W. Layman, Jun 29 2004

A001468 There are a(n) 2's between successive 1's.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

The Fibonacci word on the alphabet {2,1}, with an extra 1 in front. - Michel Dekking, Nov 26 2018
Start with 1, apply 1->12, 2->122, take limit. - Philippe Deléham, Sep 23 2005
Also number of occurrences of n in Hofstadter G-sequence (A005206) and in A019446. - Reinhard Zumkeller, Feb 02 2012, Aug 07 2011
A block-fractal sequence: every block occurs infinitely many times. Also a reverse block-fractal sequence. See A280511. - Clark Kimberling, Jan 06 2017

References

  • D. Gault and M. Clint, "Curiouser and curiouser" said Alice. Further reflections on an interesting recursive function, Internat. J. Computer Math., 26 (1988), 35-43. See Table 2.
  • D. R. Hofstadter, personal communication, Jul 15 1977.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Same as A014675 if initial 1 is deleted. Cf. A003849, A000201, A280511.
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
    import Data.List (group)
    a001468 n = a001468_list !! n
    a001468_list = map length $ group a005206_list
    -- Reinhard Zumkeller, Aug 07 2011
    
  • Maple
    Digits := 100: t := evalf( (1+sqrt(5))/2); A001468 := n-> floor((n+1)*t)-floor(n*t);
  • Mathematica
    Table[Floor[GoldenRatio*(n + 1)] - Floor[GoldenRatio*n], {n, 0, 80}] (* Joseph Biberstine (jrbibers(AT)indiana.edu), Aug 14 2006 *)
    Nest[ Flatten[# /. {1 -> {1, 2}, 2 -> {1, 2, 2}}] &, {1}, 6] (* Robert G. Wilson v, May 20 2014 and corrected Apr 24 2017 following Clark Kimberling's email of Mar 22 2017 *)
    SubstitutionSystem[{1->{1,2},2->{1,2,2}},{1},{6}][[1]] (* Harvey P. Dale, Jan 31 2022 *)
  • PARI
    a=[1];for(i=1,30,a=concat([a,vector(a[i],j,2),1]));a \\ Or compute as A001468(n)=A201(n+1)-A201(n) with A201(n)=(n+sqrtint(5*n^2))\2, working for n>=0 although A000201 is defined for n>=1. - M. F. Hasler, Oct 13 2017
    
  • Python
    def A001468(length):
        a = [1]
        for i in range(length):
            for _ in range(a[i]):
                a.append(2)
            a.append(1)
            if len(a)>=length:
                break
        return a[:length] # Nicholas Stefan Georgescu, Jun 02 2022
    
  • Python
    from math import isqrt
    def A001468(n): return (n+1+isqrt(m:=5*(n+1)**2)>>1)-(n+isqrt(m-10*n-5)>>1) # Chai Wah Wu, Aug 25 2022

Formula

a(n) = [(n+1) tau] - [n tau], tau = (1 + sqrt 5)/2 = A001622, [] = floor function.
a(n) = A000201(n+1) - A000201(n) = A022342(n+1) - A022342(n), n >= 1; i.e., the first term discarded, this yields the first differences of A000201 and A022342. - M. F. Hasler, Oct 13 2017

Extensions

Rechecked by N. J. A. Sloane, Nov 07 2001

A278040 The tribonacci representation of a(n) is obtained by appending 0,1 to the tribonacci representation of n (cf. A278038).

Original entry on oeis.org

1, 5, 8, 12, 14, 18, 21, 25, 29, 32, 36, 38, 42, 45, 49, 52, 56, 58, 62, 65, 69, 73, 76, 80, 82, 86, 89, 93, 95, 99, 102, 106, 110, 113, 117, 119, 123, 126, 130, 133, 137, 139, 143, 146, 150, 154, 157, 161, 163, 167, 170, 174, 178, 181, 185, 187, 191, 194, 198, 201, 205, 207, 211, 214, 218, 222, 225, 229, 231, 235
Offset: 0

Views

Author

N. J. A. Sloane, Nov 18 2016

Keywords

Comments

This sequence gives the A(n) numbers of the W. Lang link. There the B(n) and C(n) numbers are A278039(n) and A278041(n), respectively. - Wolfdieter Lang, Dec 05 2018
Positions of letter b in the tribonacci word t generated by a->ab, b->ac, c->a, when given offset 0. - Michel Dekking, Apr 03 2019
This sequence gives the positions of the word ab in the tribonacci word t. This follows from the fact that the letter b is always preceded in t by the letter a, and the formula AA = B-1, where A := A003144, B := A003145, C := A003146. - Michel Dekking, Apr 09 2019

Examples

			The tribonacci representation of 7 is 1000 (see A278038), so a(7) has tribonacci representation 100001, which is 24+1 = 25, so a(7) = 25.
		

Crossrefs

By analogy with the Wythoff compound sequences A003622 etc., the nine compounds of A003144, A003145, A003146 might be called the tribonacci compound sequences. They are A278040, A278041, and A319966-A319972.

Formula

a(n) = A003145(n+1) - 1.
a(n) = A003144(A003144(n)). - N. J. A. Sloane, Oct 05 2018
See Theorem 13 in the Carlitz, Scoville and Hoggatt paper. - Michel Dekking, Mar 20 2019
From Wolfdieter Lang, Dec 13 2018: (Start)
This sequence gives the indices k with A080843(k) = 1, ordered increasingly with offset 0.
a(n) = 1 + 4*n - A319198(n-1), n >= 0, with A319198(-1) = 0.
a(n) = A276796(C(n)) - 1, with C(n) = A278041(n).
For a proof see the W. Lang link, Proposition 5, and eq. (58).
a(n) - 1 = B1(n), where B1-numbers are B-numbers from A278039 followed by an A-number from A278040. See a comment and example in A319968.
a(n) - 1 = B(B(n)) = B(B(n) + 1) - 2, for n > = 0, where B = A278039.
(End)

A066096 a(n) = floor(n*phi), where phi = (1 + sqrt(5))/2.

Original entry on oeis.org

0, 1, 3, 4, 6, 8, 9, 11, 12, 14, 16, 17, 19, 21, 22, 24, 25, 27, 29, 30, 32, 33, 35, 37, 38, 40, 42, 43, 45, 46, 48, 50, 51, 53, 55, 56, 58, 59, 61, 63, 64, 66, 67, 69, 71, 72, 74, 76, 77, 79, 80, 82, 84, 85, 87, 88, 90, 92, 93, 95, 97, 98, 100, 101, 103, 105, 106
Offset: 0

Views

Author

Michele Dondi (bik.mido(AT)tiscalenet.it), Dec 30 2001

Keywords

Comments

a(n) is the smallest number different from a(i) and a(i)+i for i < n.
The losing positions in the game of Wythoff-Nim are precisely the pairs (a(n), a(n)+n).

Crossrefs

Programs

  • Magma
    [Floor((1+Sqrt(5))*n/2): n in [0..80]]; // G. C. Greubel, Sep 12 2023
    
  • Mathematica
    Floor[GoldenRatio*Range[0, 80]] (* G. C. Greubel, Sep 12 2023 *)
  • PARI
    a(n) = (n+sqrtint(5*n^2))\2;
    [a(n)|n<-[0..100]] \\ Simon Strandgaard, Jun 28 2022
    
  • SageMath
    [floor(golden_ratio*n) for n in range(81)] # G. C. Greubel, Sep 12 2023

Formula

For n >= 1, a(n) = A000201(n).
Duplicate values in A060143.
a(n) = 1 + A022342(n) = A000201(n).
a(n) = floor(n*phi), where phi = (1 + sqrt(5))/2. - Peter Munn, Jan 12 2018
a(n) = A026351(n) - 1. - Philippe Deléham, Jan 15 2023

Extensions

Name corrected by Peter Munn, Dec 06 2017
New name using a formula from Peter Munn by Peter Luschny, Jan 18 2023

A003623 Wythoff AB-numbers: floor(floor(n*phi^2)*phi), where phi = (1+sqrt(5))/2.

Original entry on oeis.org

3, 8, 11, 16, 21, 24, 29, 32, 37, 42, 45, 50, 55, 58, 63, 66, 71, 76, 79, 84, 87, 92, 97, 100, 105, 110, 113, 118, 121, 126, 131, 134, 139, 144, 147, 152, 155, 160, 165, 168, 173, 176, 181, 186, 189, 194, 199, 202, 207, 210, 215, 220, 223, 228, 231, 236, 241, 244, 249
Offset: 1

Views

Author

Keywords

Comments

Previous name was: "From a 3-way splitting of positive integers: [[n*phi^2]*phi]."
Union of A001950 & A003622 & A003623 = A000027.
a(n) is odd if and only if n is odd. - Clark Kimberling, Apr 21 2011
A005614(a(n)-1)=1 and A005614(a(n))=1, n>=1. Because Wythoff AB-numbers (see the formula section) mark the first entry of pairs of 1s in the rabbit sequence A005614(n-1), n>=1. - Wolfdieter Lang, Jun 28 2011
a(n) = k if and only if A270788(k) = 3, where A270788 is the infinite Fibonacci word on {1,2,3}. - Michel Dekking, Sep 07 2016
The asymptotic density of this sequence is 1/phi^3 = phi^3 - 4 = A098317 - 4 = 0.236067... . - Amiram Eldar, Mar 24 2025

References

  • Joe Roberts, Lure of the Integers, Math. Assoc. America, 1992, p. 10.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Let A = A000201, B = A001950. Then AA = A003622, AB = A003623, BA = A035336, BB = A101864.

Programs

  • Maple
    A003623:=proc(n) return floor(floor(n*(3+sqrt(5))/2)*(1+sqrt(5))/2); end:seq(A003623(n),n=1..59); # Nathaniel Johnston, Apr 21 2011
  • Mathematica
    f[n_] := Floor[ GoldenRatio * Floor[ n * GoldenRatio^2]]; Array[f, 47]
    (* another *) Table[n+2Floor[n*GoldenRatio],{n,1,100}]
  • PARI
    a(n)=(n+sqrtint(5*n^2))\2*2+n \\ Charles R Greathouse IV, Jan 25 2022
  • Python
    from sympy import floor
    from mpmath import phi
    def a(n): return floor(n*phi) + floor(n*phi**2) # Indranil Ghosh, Jun 10 2017
    
  • Python
    from math import isqrt
    def A003623(n): return (n+isqrt(5*n**2)&-2)+n # Chai Wah Wu, Aug 25 2022
    

Formula

a(n) = floor(n*phi) + floor(n*phi^2) = A000201(n) + A001950(n).
a(n) = 2*floor(n*phi) + n = 2*A000201(n) + n.
a(n) = A(B(n)) with A(k):=A000201(k) and B(k):=A001950(k), k>=1 (Wythoff AB-numbers).

Extensions

Name improved by Michel Dekking, Sep 07 2016
Previous Showing 11-20 of 88 results. Next