Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #5 Mar 30 2012 18:57:33
%S 1,2,1,1,2,1,1,1,2,2,1,1,1,1,2,1,2,1,1,1,1,2,1,2,2,1,1,2,1,1,1,1,1,2,
%T 1,2,2,1,1,1,2,1,1,1,1,1,2,1,2,1,1,2,2,2,1,1,1,1,1,2,1,1,1,1,1,1,2,1,
%U 1,2,1,1,2,2,2,2,1,1,1,1,1,1,2,1,2,1
%N Lim f(f(...f(n)...)) where f(n) is the Farey fractal sequence, A131967.
%C Suppose that f(1), f(2), f(3),... is a fractal sequence (a sequence which contains itself as a proper subsequence, such as 1, 2, 1, 2, 3, 1, 2, 3, 4, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 6, ...; if the first occurrence of each n is deleted, the remaining sequence is identical to the original; see the Wikipedia article for a rigorous definition). Then for each n>=1, the limit L(n) of composites f(f(f...f(n)...)) exists and is one of the numbers in the set {k : f(k)=k}. Thus, if f(2)>2, then L(n)=1 for all n; if f(2)=2 and f(3)>3, then L(n) is 1 or 2 for all n. Examples: A020903, A191770, A191774
%H Wikipedia, <a href="http://en.wikipedia.org/wiki/Fractal_sequence">Fractal sequence</a>
%e Write the counting numbers and A131967 like this:
%e 1..2..3..4..5..6..7..8..9..10..11..12..13..14..15..
%e 1..2..1..3..2..1..4..3..5..2...1...6...4...3...5...
%e It is then easy to check composites:
%e 1->1, 2->2, 3->1, 4->3->1, 5->2, 6->1, 7->4->3->1,...
%t Farey[n_] := Select[Union@Flatten@Outer[Divide, Range[n + 1] - 1, Range[n]], # <= 1 &];
%t newpos[n_] := Module[{length = Total@Array[EulerPhi, n] + 1, f1 = Farey[n], f2 = Farey[n - 1], to},
%t to = Complement[Range[length], Flatten[Position[f1, #] & /@ f2]];
%t ReplacePart[Array[0 &, length],
%t Inner[Rule, to, Range[length - Length[to] + 1, length], List]]];
%t a[n_] := Flatten@Table[Fold[ReplacePart[Array[newpos, i][[#2 + 1]], Inner[Rule, Flatten@Position[Array[newpos, i][[#2 + 1]], 0], #1, List]] &, Array[newpos, i][[1]], Range[i - 1]], {i, n}];
%t t = a[12]; f[n_] := Part[t, n];
%t Table[f[n], {n, 1, 100}] (* A131967 *)
%t h[n_] := Nest[f, n, 50]
%t t = Table[h[n], {n, 1, 200}] (* A191774 *)
%t s = Flatten[Position[t, 1]] (* A191775 *)
%t s = Flatten[Position[t, 2]] (* A191776 *)
%Y Cf. A020903, A191770, A191775, A191776.
%K nonn
%O 1,2
%A _Clark Kimberling_, Jun 16 2011