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.
%I A191774 #5 Mar 30 2012 18:57:33 %S A191774 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 A191774 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 A191774 1,2,1,1,2,2,2,2,1,1,1,1,1,1,2,1,2,1 %N A191774 Lim f(f(...f(n)...)) where f(n) is the Farey fractal sequence, A131967. %C A191774 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 A191774 Wikipedia, <a href="http://en.wikipedia.org/wiki/Fractal_sequence">Fractal sequence</a> %e A191774 Write the counting numbers and A131967 like this: %e A191774 1..2..3..4..5..6..7..8..9..10..11..12..13..14..15.. %e A191774 1..2..1..3..2..1..4..3..5..2...1...6...4...3...5... %e A191774 It is then easy to check composites: %e A191774 1->1, 2->2, 3->1, 4->3->1, 5->2, 6->1, 7->4->3->1,... %t A191774 Farey[n_] := Select[Union@Flatten@Outer[Divide, Range[n + 1] - 1, Range[n]], # <= 1 &]; %t A191774 newpos[n_] := Module[{length = Total@Array[EulerPhi, n] + 1, f1 = Farey[n], f2 = Farey[n - 1], to}, %t A191774 to = Complement[Range[length], Flatten[Position[f1, #] & /@ f2]]; %t A191774 ReplacePart[Array[0 &, length], %t A191774 Inner[Rule, to, Range[length - Length[to] + 1, length], List]]]; %t A191774 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 A191774 t = a[12]; f[n_] := Part[t, n]; %t A191774 Table[f[n], {n, 1, 100}] (* A131967 *) %t A191774 h[n_] := Nest[f, n, 50] %t A191774 t = Table[h[n], {n, 1, 200}] (* A191774 *) %t A191774 s = Flatten[Position[t, 1]] (* A191775 *) %t A191774 s = Flatten[Position[t, 2]] (* A191776 *) %Y A191774 Cf. A020903, A191770, A191775, A191776. %K A191774 nonn %O A191774 1,2 %A A191774 _Clark Kimberling_, Jun 16 2011