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.

A113825 Number of distinct prime factors of A008351(n).

Original entry on oeis.org

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

Views

Author

Parthasarathy Nambi, Jan 23 2006

Keywords

Examples

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

Crossrefs

A008351: Concatenate a(n-1) and a(n-2) with a(1)=1 & a(2)=2.
Cf. A008351.

Extensions

a(11)-a(13) from Robert G. Wilson v, Jan 27 2006

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

A008352 a(n) is formed by concatenating a(n-2) and a(n-1), with a(0) = 1, a(1) = 2.

Original entry on oeis.org

1, 2, 12, 212, 12212, 21212212, 1221221212212, 212122121221221212212, 1221221212212212122121221221212212, 2121221212212212122121221221212212212122121221221212212
Offset: 0

Views

Author

Keywords

Comments

A "non-commutative Fibonacci" (or "reverse Fibonacci") sequence. Often written as: a, b, ab, bab, abbab, bababbab, abbabbababbab, bababbababbabbababbab, abbabbababbabbababbababbabbababbab, bababbababbabbababbababbabbababbabbababbababbabbababbab, ...
Converges in the appropriate topology. - Dylan Thurston, Jan 28 2005
Do a web search on bababbababbabbababbab to get further links.
From Andrew Hone, Jan 28 2005: (Start)
Write the recurrence symbolically as g_{n+1} = g_{n-1}g_n. Then the determinant d_n = det g_n is given by d_n = d_0^{f_{n-2}} d_1^{f_{n-1}} where f_{n+1} = f_n+f_{n-1}, f_0 = f_1 = 1 are the Fibonacci numbers.
To avoid getting involved with the Baker-Campbell-Hausdorff identity, I now restrict to SL(2), or to make life easier make it SU(2) (which is isomorphic over C). Then we can explicitly write g as an exponential of Lie algebra elements:
g_n = exp (i theta_n v_n cdot sigma ), where theta_n is an angle, v_n is a unit vector and sigma = ( sigma_1, sigma_2, sigma_3)^T is a vector of Pauli spin matrices.
Moreover the adjoint action on su(2) (viewing the coordinates in su(2) as giving points in 3D space) means that g_n gives a rotation through - theta_n /2 about the v_n axis.
So from the double cover of SO(3) by SU(2), we can view the g_n as a sequence of "Fibonacci rotations."
Furthermore, in SU(2) we can write explicitly g_n = cos theta_n + i sin theta_n v_n cdot sigma so the recurrence can be decoupled as
cos theta_{n+1} = cos theta_n + cos theta_{n-1} - sin theta_{n-1} sin theta_n (v_{n-1} cdot v_n),
sin theta_{n+1} v_{n+1} = cos theta_{n-1} sin theta_n v_n + cos theta_n sin theta_{n-1} v_{n-1} - sin theta_{n-1} sin theta_n ( v_{n-1} wedge v_n ). (End)
Changing the offset to 1, the sum of the digits of a(n) is 2*Fib(n-1)+Fib(n-2), where Fib(n) means A000045(n), the n-th Fibonacci number. - Stefan Steinerberger, Feb 05 2006
Let beta be the reversed, mirrored Fibonacci morphism on the alphabet {1,2} given by beta(1)=2, beta(2)=12. Then a(n) = beta^n(1), since from the formula beta^2(1)= 12 = 1 beta(1), one sees directly that the iterates of the letter 1 under beta satisfy the defining recursion a(n) = a(n-2)a(n-1). It follows that the a(2n) converge to A189479 with 1,2 replaced by 0 and 1, and the a(2n+1) converge to A287523 with 1,2 replaced by 0 and 1. - Michel Dekking, Sep 30 2019

References

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

Crossrefs

See A008351 and A003849 for other versions.

Programs

  • Maple
    f:=proc(n) option remember; if n = 0 then return(`1`); fi; if n = 1 then return(`2`); fi; cat(f(n-2), f(n-1) ); end;
  • Mathematica
    nxt[{a_,b_}]:={b,FromDigits[Join[IntegerDigits[a],IntegerDigits[b]]]}; NestList[ nxt,{1,2},10][[All,1]] (* Harvey P. Dale, Jul 16 2017 *)

Formula

With offset set to 1, a(1)=1 and a(2)=2, then a(n) = a(n-1)+10^A000045(n)*a(n-2). - Benoit Cloitre, Nov 24 2001
a(n) = beta^n(1), where beta is the morphism 1->2, 2->12. - Michel Dekking, Sep 30 2019
Showing 1-3 of 3 results.