A258239 Irregular triangle (Beatty tree for r = 2 + sqrt(2)), T, of all nonnegative integers, each exactly once, as determined in Comments.
0, 3, 1, 13, 6, 4, 47, 2, 17, 23, 14, 163, 5, 7, 10, 51, 61, 81, 48, 559, 27, 37, 15, 18, 20, 24, 167, 177, 211, 279, 164, 1911, 8, 11, 54, 64, 71, 85, 95, 129, 49, 52, 62, 82, 563, 573, 607, 723, 955, 560, 6527, 30, 40, 16, 19, 21, 25, 28, 38, 170, 180, 187
Offset: 1
Examples
Rows (or generations, or levels) of T: 0 3 1 13 6 4 47 2 23 17 14 163 10 7 81 5 61 51 48 559 37 27 24 279 20 18 211 15 177 167 164 1911 Generations 0 to 7 of the tree are drawn by the Mathematica program. In T, the path from 0 to 8 is (0,3,1,6,23,7,27,8). The path obtained by backtracking (i.e., successive applications of the mapping b in Comments) is (8,27,7,23,6,1,3,0).
Programs
-
Mathematica
r = 2+Sqrt[2]; k = 1000; w = Map[Floor[r #] &, Range[k]]; f[x_] := f[x] = If[MemberQ[w, x], Floor[x/r], Floor[r*x]]; b := NestWhileList[f, #, ! # == 0 &] &; bs = Map[Reverse, Table[b[n], {n, 0, k}]]; generations = Table[DeleteDuplicates[Map[#[[n]] &, Select[bs, Length[#] > n - 1 &]]], {n, 8}] paths = Sort[Map[Reverse[b[#]] &, Last[generations]]] graph = DeleteDuplicates[Flatten[Map[Thread[Most[#] -> Rest[#]] &, paths]]] TreePlot[graph, Top, 0, VertexLabeling -> True, ImageSize -> 700] Map[DeleteDuplicates, Transpose[paths]] (* Peter J. C. Moses,May 21 2015 *)
Comments