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.

A125047 Infinite word generated by mapping 1->12, 2->13, 3->43, 4->42 starting at 1.

Original entry on oeis.org

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

Views

Author

Michael Somos, Nov 17 2006

Keywords

Comments

Infinite word over 4-letter alphabet that contains no squares in arithmetic progressions of odd difference. - Ralf Stephan, May 09 2007

Examples

			1 -> 12 -> 1213 -> 12131242 -> 1213124312134243 -> ...
		

Crossrefs

Essentially the same: A112658 (map 1234 -> 1023), A122002 (map 1234 -> 5137).
Cf. A038190.

Programs

  • Mathematica
    SubstitutionSystem[{1 -> {1, 2}, 2 -> {1, 3}, 3 -> {4, 3}, 4 -> {4, 2}}, {1}, 7] // Last (* Jean-François Alcover, Dec 17 2018 *)
  • PARI
    {a(n)=local(A); if(n<1, 0, A=[1]; while(length(A)
    				
  • PARI
    my(table=[1,2;4,3]); a(n) = n--; table[if(n,bittest(n,1+valuation(n,2)))+1, n%2+1]; \\ Kevin Ryde, Sep 05 2020

Formula

Recurrence: a(1)=1, a(4n)=3, a(4n+2)=2, a(8n+3)=1, a(8n+7)=4, a(4n+1)=a(2n+1). - Ralf Stephan, May 09 2007