A125047 Infinite word generated by mapping 1->12, 2->13, 3->43, 4->42 starting at 1.
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
Keywords
Examples
1 -> 12 -> 1213 -> 12131242 -> 1213124312134243 -> ...
Links
- Jui-Yi Kao, Narad Rampersad, Jeffrey Shallit, Manuel Silva, Words avoiding repetitions in arithmetic progressions, Theoretical Computer Science, volume 391, issues 1-2, February 2008, pages 126-137. And arXiv:math/0608607 [math.CO], 2006.
- Index entries for sequences that are fixed points of mappings
Crossrefs
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
Comments