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.

A113773 Number of distinct prime factors of A008352.

Original entry on oeis.org

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

Views

Author

Parthasarathy Nambi, Jan 19 2006

Keywords

Comments

a(13) >= 11.

Examples

			The number of distinct prime factors of 212 is 2 which is the third term in the sequence.
		

Crossrefs

Cf. A008352.

Programs

  • Maple
    catL := proc(a,b) a*10^(max(1,ilog10(b)+1))+b ; end: A008352 := proc(n) option remember ; if n <= 1 then n+1 ; else catL( A008352(n-2),A008352(n-1)) ; fi ; end: A113773 := proc(n) nops( numtheory[factorset](A008352(n))) ; end: for n from 1 do print(A113773(n)) ; od: # R. J. Mathar, Feb 06 2008

Extensions

More terms from Sean A. Irvine, Feb 22 2011

A003849 The infinite Fibonacci word (start with 0, apply 0->01, 1->0, take limit).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

A Sturmian word.
Define strings S(0)=0, S(1)=01, S(n)=S(n-1)S(n-2); iterate; sequence is S(infinity). If the initial 0 is omitted from S(n) for n>0, we obtain A288582(n+1).
The 0's occur at positions in A022342 (i.e., A000201 - 1), the 1's at positions in A003622.
Replace each run (1;1) with (1;0) in the infinite Fibonacci word A005614 (and add 0 as prefix) A005614 begins: 1,0,1,1,0,1,0,1,1,0,1,1,... changing runs (1,1) with (1,0) produces 1,0,0,1,0,1,0,0,1,0,0,1,... - Benoit Cloitre, Nov 10 2003
Characteristic function of A003622. - Philippe Deléham, May 03 2004
The fraction of 0's in the first n terms approaches 1/phi (see for example Allouche and Shallit). - N. J. A. Sloane, Sep 24 2007
The limiting mean and variance of the first n terms are 2-phi and 2*phi-3, respectively. - Clark Kimberling, Mar 12 2014, Aug 16 2018
Let S(n) be defined as above. Then this sequence is S(1) + Sum_{n=0..} S(n), where the addition of strings represents concatenation. - Isaac Saffold, May 03 2019
The word is a concatenation of three runs: 0, 1, and 00. The limiting proportions of these are respectively 1 - phi/2, 1/2, and (phi - 1)/2. The mean runlength is (phi + 1)/2. - Clark Kimberling, Dec 26 2010
From Amiram Eldar, Mar 10 2021: (Start)
a(n) is the number of the trailing 0's in the dual Zeckendorf representation of (n+1) (A104326).
The asymptotic density of the occurrences of k (0 or 1) is 1/phi^(k+1), where phi is the golden ratio (A001622).
The asymptotic mean of this sequence is 1/phi^2 (A132338). (End)

Examples

			The word is 010010100100101001010010010100...
Over the alphabet {a,b} this is 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. 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.
  • Wolfdieter Lang, The Wythoff and the Zeckendorf representations of numbers are equivalent, in G. E. Bergum et al. (edts.) Application of Fibonacci numbers vol. 6, Kluwer, Dordrecht, 1996, pp. 319-337. [See A317208 for a link.]
  • G. Melançon, Factorizing infinite words using Maple, MapleTech journal, vol. 4, no. 1, 1997, pp. 34-42, esp. p. 36.
  • Michel Rigo, Formal Languages, Automata and Numeration Systems, 2 vols., Wiley, 2014. Mentions this sequence - see "List of Sequences" in Vol. 2.

Crossrefs

There are several versions of this sequence in the OEIS. This one and A003842 are probably the most important. See also A008352, A076662, A288581, A288582.
Positions of 1's gives A003622.
Sequences mentioned in the Allouche et al. "Taxonomy" paper, listed by example number: 1: A003849, 2: A010060, 3: A010056, 4: A020985 and A020987, 5: A191818, 6: A316340 and A273129, 18: A316341, 19: A030302, 20: A063438, 21: A316342, 22: A316343, 23: A003849 minus its first term, 24: A316344, 25: A316345 and A316824, 26: A020985 and A020987, 27: A316825, 28: A159689, 29: A049320, 30: A003849, 31: A316826, 32: A316827, 33: A316828, 34: A316344, 35: A043529, 36: A316829, 37: A010060.
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
    a003849 n = a003849_list !! n
    a003849_list = tail $ concat fws where
       fws = [1] : [0] : (zipWith (++) fws $ tail fws)
    -- Reinhard Zumkeller, Nov 01 2013, Apr 07 2012
    
  • Magma
    t1:=[ n le 2 select ["0","0,1"][n] else Self(n-1) cat "," cat Self(n-2) : n in [1..12]]; t1[12];
    
  • Maple
    z := proc(m) option remember; if m=0 then [0] elif m=1 then [0,1] else [op(z(m-1)),op(z(m-2))]; fi; end; z(12);
    M:=19; S[0]:=`0`; S[1]:=`01`; for n from 2 to M do S[n]:=cat(S[n-1], S[n-2]); od:
    t0:=S[M]: l:=length(t0); for i from 1 to l do lprint(i-1,substring(t0,i..i)); od: # N. J. A. Sloane, Nov 01 2006
  • Mathematica
    Nest[ Flatten[ # /. {0 -> {0, 1}, 1 -> {0}}] &, {0}, 10] (* Robert G. Wilson v, Mar 05 2005 *)
    Flatten[Nest[{#, #[[1]]} &, {0, 1}, 9]] (* IWABUCHI Yu(u)ki, Oct 23 2013 *)
    Table[Floor[(n + 2) #] - Floor[(n + 1) #], {n, 0, 120}] &[2 - GoldenRatio] (* Michael De Vlieger, Aug 15 2016 *)
    SubstitutionSystem[{0->{0,1},1->{0}},{0},{10}][[1]] (* Harvey P. Dale, Dec 20 2021 *)
  • PARI
    a(n)=my(k=2);while(fibonacci(k)<=n,k++);while(n>1,while(fibonacci(k--)>n,); n-=fibonacci(k)); n==1 \\ Charles R Greathouse IV, Feb 03 2014
    
  • PARI
    M3849=[2,2,1,0]/*L(k),S(k),L(k-1),S(k-1)*/; A003849(n)={while(n>M3849[1],M3849=vecextract(M3849,[1,2,1,2])+[M3849[3],M3849[4]<M. F. Hasler, Apr 07 2021
    
  • Python
    def fib(n):
        """Return the concatenation of A003849(0..F-1) where F is the smallest
           Fibonacci number > n, so that the result contains a(n) at index n."""
        a, b = '10'
        while len(b)<=n:
            a, b = b, b + a
        return b # Robert FERREOL, Apr 15 2016, edited by M. F. Hasler, Apr 07 2021
    
  • Python
    from math import isqrt
    def A003849(n): return 2-(n+2+isqrt(m:=5*(n+2)**2)>>1)+(n+1+isqrt(m-10*n-15)>>1) # Chai Wah Wu, Aug 25 2022

Formula

a(n) = floor((n+2)*r) - floor((n+1)*r) where r=phi/(1+2*phi) and phi is the Golden Ratio. - Benoit Cloitre, Nov 10 2003
a(n) = A003714(n) mod 2 = A014417(n) mod 2. - Philippe Deléham, Jan 04 2004
The first formula by Cloitre is just one of an infinite family of formulas. Using phi^2=1+phi, it follows that r=phi/(1+2*phi)=2-phi. Then from floor(-x)=-floor(x)-1 for non-integer x, it follows that a(n)=2-A014675(n)=2-(floor((n+2)* phi)-floor((n+1)*phi)). - Michel Dekking, Aug 27 2016
a(n) = 1 - A096270(n+1), i.e., A096270 is the complement of this sequence. - A.H.M. Smeets, Mar 31 2024

Extensions

Revised by N. J. A. Sloane, Jul 03 2012

A008351 a(n) is the concatenation of a(n-1) and a(n-2) with a(1)=1, a(2)=2.

Original entry on oeis.org

1, 2, 21, 212, 21221, 21221212, 2122121221221, 212212122122121221212, 2122121221221212212122122121221221, 2122121221221212212122122121221221212212122122121221212
Offset: 1

Views

Author

Keywords

Comments

A "non-commutative Fibonacci" sequence. Often written as: a, b, ba, bab, babba, babbabab, babbababbabba, babbababbabbababbabab, ...
Converges in the appropriate topology. - Dylan Thurston, Jan 28 2005
Do a web search on babbababbabbababbabab to get further links.
a(n) has Fibonacci(n) digits d_i where 1 <= i <= n and n > 2. If i is in A001950 then d_i = 1, otherwise it is 2 [Stolarsky]. - David A. Corneth, May 14 2017

References

  • D. E. Knuth, "The Art of Programming", Volume 1, "Fundamental Algorithms", third edition, problem 36 on page 86.

Crossrefs

See A008352 for another version.
Cf. A014675: 1->2, 2->21.
Cf. A001950.

Programs

  • Mathematica
    a[1] = 1; a[2] = 2; a[n_] := 10^Floor[ Log[10, a[n - 2]] +1]*a[n - 1] + a[n - 2] (* Robert G. Wilson v, Jan 26 2006 *)
  • PARI
    a(n) = if (n<=2, n, eval(concat(Str(a(n-1)), Str(a(n-2))))); \\ Michel Marcus, May 14 2017
    
  • PARI
    a(n) = {if(n<=2, return(n));
    my(v=vector(fibonacci(n),i,2), phi2 = (3+sqrt(5))/2, b = vector(fibonacci(n-2), i, (i*(sqrt(5)+3)/2))\1); for(i=1, fibonacci(n-2), v[(i*(3+sqrt(5))/2)\1] = 1); sum(i=1,#v,10^(#v-i) * v[i])}
    a(n) = my(v=vector(n)); if(n <= 2, return(n)); v[1] = 1; v[2] = 2; for(i=3, n, v[i]=eval(concat(Str(v[i-1]), Str(v[i-2])))); v[#v] \\ David A. Corneth, May 14 2017

Extensions

Title clarified by Chai Wah Wu, Mar 17 2021

A113526 Define the first two terms to be 1 and 3. All the other terms are obtained by concatenating the two previous terms.

Original entry on oeis.org

1, 3, 13, 313, 13313, 31313313, 1331331313313, 313133131331331313313, 1331331313313313133131331331313313, 3131331313313313133131331331313313313133131331331313313
Offset: 1

Views

Author

Parthasarathy Nambi, Jan 12 2006

Keywords

Examples

			The third term is 13 which is obtained by concatenating the two previous terms 1 and 3.
		

Crossrefs

Cf. A008352.

Programs

  • Mathematica
    a[1] = 1; a[2] = 3; a[n_] := FromDigits@ Join[IntegerDigits@a[n - 2], IntegerDigits@a[n - 1]]; Array[a, 10] (* Robert G. Wilson v *)
    nxt[{a_,b_}]:={b,FromDigits[Join[Flatten[IntegerDigits/@{a,b}]]]}; NestList[nxt,{1,3},10][[All,1]] (* Harvey P. Dale, May 15 2017 *)

Extensions

More terms from Robert G. Wilson v, Jan 18 2006

A133235 Numerical encoding of a series of binary words generated by a recurrence - see comments.

Original entry on oeis.org

22, 2222, 22211222, 22211222211222, 222112222112211222211222, 2221122221122112222112222112211222211222, 222112222112211222211222211221122221122112222112222112211222211222
Offset: 0

Views

Author

N. J. A. Sloane, Oct 14 2007, based on an email message from James Propp, Jan 28 2005

Keywords

Comments

The sequence of words is bb, bbbb, bbbaabbb, bbbaabbbbaabbb, bbbaabbbbaabbaabbbbaabbb, ... given by the rule that the n-th word consists of the (n-1)st word, followed by the inverse of the (n-3)rd word, followed by the (n-1)st word.
Here a (or 1) and 2 (or b) represent the respective matrices
[1 1] [2 1]
[1 0] [1 0]
arising in the study of Markov numbers (A002559) - see link.
Question: Can this substitution-deletion system be described by a simple morphism of the type shown in A008352?

Examples

			a(4) = bbbaabbbbaabbaabbbbaabbb, a(2) = bbbaabbb, so a(5) = bbbaabbbbaabbaabbbbaabbb (bbbaabbb)^(-1) bbbaabbbbaabbaabbbbaabbb = bbbaabbbbaabbaabbbbaabbbbaabbaabbbbaabbb
		

Crossrefs

A113765 Define the first two terms to be 1 and 7. All the other terms are obtained by concatenating the two previous terms.

Original entry on oeis.org

1, 7, 17, 717, 17717, 71717717, 1771771717717, 717177171771771717717, 1771771717717717177171771771717717, 7171771717717717177171771771717717717177171771771717717
Offset: 0

Views

Author

Parthasarathy Nambi, Jan 18 2006

Keywords

Comments

a(n) has Fibonacci(n) digits and the sum of all digits is given by Fibonacci(n-2)+7*Fibonacci(n-1) for all n>4. - Stefan Steinerberger, Jan 21 2006

Examples

			The third term is 17 and it is obtained by concatenating the two previous terms 1 and 7.
		

Crossrefs

Cf. A000045 - the Fibonacci numbers.

Extensions

More terms from Stefan Steinerberger, Jan 21 2006

A334025 a(0)=0, a(1)=1; and a(n) = {2*a(n-2), 2*a(n-1)}, where {x,y} is the concatenation of x and y.

Original entry on oeis.org

0, 1, 2, 24, 448, 48896, 89697792, 97792179395584, 179395584195584358791168, 195584358791168358791168391168717582336, 358791168391168717582336391168717582336717582336782337435164672
Offset: 0

Views

Author

Jamie Robert Creasey, Apr 14 2020

Keywords

Comments

This sequence, due to the process of concatenating one number with another, bears similarities to A131293 and other familiar sequences. However, unlike A131293, this sequence increases at a faster rate. It happens due to the multiplier applied to the existing terms, which increases the number of digits present in the successive term drastically (see a(7) and a(8)). a(11) is too large to include here and has 102 digits.

Examples

			a(2) = {2*a(2-2), 2*a(2-1)} = {2*0, 2*1} = 02 = 2.
a(5) = {2*a(5-2), 2*a(5-1)} = {2*24, 2*448} = 48896.
		

Crossrefs

Programs

  • Mathematica
    a[0] = 0; a[1] = 1; a[n_] := a[n] = FromDigits @ Join[IntegerDigits[2*a[n - 2]], IntegerDigits[2*a[n - 1]]]; Array[a, 11, 0] (* Amiram Eldar, Apr 18 2020 *)
Showing 1-7 of 7 results.