A105220 Trajectory of 1 under the morphism 1->{1,2,1}, 2->{2,2,2}.
1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
Offset: 0
Keywords
Links
- Antti Karttunen, Table of n, a(n) for n = 0..19682
- F. M. Dekking, Recurrent Sets, Advances in Mathematics, vol. 44, no. 1, 1982, page 99, section 4.15
- Wikipedia, L-system Example 3: Cantor dust
- Index entries for sequences that are fixed points of mappings
Programs
-
Mathematica
Flatten[ Nest[ Flatten[ # /. {1 -> {1, 2, 1}, 2 -> {2, 2, 2}} &], {1}, 5]]
-
PARI
A088917(n) = { while(n, if(n%3==1, return(0), n\=3)); (1); }; \\ Originally from A005823 A105220(n) = (2-A088917(n)); \\ Antti Karttunen, Aug 23 2019
Formula
a(n) = 2 if the ternary expansion of n contains the digit 1, otherwise a(n) = 1. - Joerg Arndt, Aug 24 2019
Comments