OFFSET
1,2
COMMENTS
As a fractal sequence, A131967 properly contains itself as a subsequence (infinitely many times).
Step 1: List the Farey fractions by order, like this:
order 1: 0/1 1/1
order 2: 0/1 1/2 1/1
order 3: 0/1 1/3 1/2 2/3 1/1, etc.
Step 2: Replace each a/b by its position when all the segments in Step 1 are concatenated and each distinct predecessor of a/b is counted just once, getting
1 2
1 3 2
1 4 3 5 2, etc.
Step 3: Concatenate the segments found in Step 2.
REFERENCES
C. Kimberling, "Fractal sequences and interspersions," Ars Combinatoria 45 (1997) 157-168.
EXAMPLE
The Farey fractions of order 4 are
0 1/4 1/3 1/2 2/3 3/4 1, having position numbers
1 6 4 3 5 7 2, which is the fourth segment in the formation of A131967.
MATHEMATICA
Farey[n_] :=
Select[Union@
Flatten@Outer[Divide, Range[n + 1] - 1, Range[n]] , # <= 1 &];
newpos[n_] :=
Module[{length = Total@Array[EulerPhi, n] + 1, f1 = Farey[n],
f2 = Farey[n - 1], to},
to = Complement[Range[length], Flatten[Position[f1, #] & /@ f2]];
ReplacePart[Array[0 &, length],
Inner[Rule, to, Range[length - Length[to] + 1, length], List]]];
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}];
a[10] (* Birkas Gyorgy, Feb 21 2011 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Clark Kimberling, Aug 02 2007
STATUS
approved