cp's OEIS Frontend

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.

A258241 Irregular triangle (Beatty tree for r = sqrt(3)), T, of all nonnegative integers, each exactly once, as determined in Comments.

This page as a plain text file.
%I A258241 #4 Jun 07 2015 18:03:43
%S A258241 0,1,3,2,6,4,5,12,7,8,10,22,15,19,13,39,9,11,24,27,23,34,69,14,16,17,
%T A258241 20,48,60,40,41,43,121,31,36,25,28,29,35,72,76,84,105,70,71,211,18,21,
%U A258241 45,51,64,42,44,49,50,55,61,62,126,147,183,122,124,133,367
%N A258241 Irregular triangle (Beatty tree for r = sqrt(3)), T, of all nonnegative integers, each exactly once, as determined in Comments.
%C A258241 Suppose that r is an irrational number > 1, and let s = r/(r-1), so that the sequences u and v defined by u(n) = floor(r*n) and v(n) = floor(s*n), for n >=1 are the Beatty sequences of r and s, and u and v partition the positive integers.
%C A258241 The tree T has root 0 with an edge to 1, and all other edges are determined as follows:  if x is in u(v), then there is an edge from x to floor(r + r*x) and an edge from x to ceiling(x/r); otherwise there is an edge from x to floor(r + r*x).  (Thus, the only branchpoints are the numbers in u(v).)
%C A258241 Another way to form T is by "backtracking" to the root 0.  Let b(x) = floor[x/r] if x is in (u(n)), and b(x) = floor[r*x] if x is in (v(n)).  Starting at any vertex x, repeated applications of b eventually reach 0.  The number of steps to reach 0 is the number of the generation of T that contains x.  (See Example for x = 8).
%C A258241 See A258212 for a guide to Beatty trees for various choices of r.
%e A258241 Rows (or generations, or levels) of T:
%e A258241 0
%e A258241 1
%e A258241 3
%e A258241 2   6
%e A258241 4   5   12
%e A258241 7   8   10  22
%e A258241 15  19  13  39
%e A258241 9   11  24  27  23  34  69
%e A258241 14  16  17  20  48  60  40  41  43  121
%e A258241 Generations 0 to 10 of the tree are drawn by the Mathematica program.  In T, the path from 0 to 16 is (0,1,3,6,4,8,15,27,16).  The path obtained by backtracking (i.e., successive applications of the mapping b in Comments) is (16,27,15,8,4,6,3,1,0).
%t A258241 r = Sqrt[3]; k = 2000; w = Map[Floor[r #] &, Range[k]];
%t A258241 f[x_] := f[x] = If[MemberQ[w, x], Floor[x/r], Floor[r*x]];
%t A258241 b := NestWhileList[f, #, ! # == 0 &] &;
%t A258241 bs = Map[Reverse, Table[b[n], {n, 0, k}]];
%t A258241 generations = Table[DeleteDuplicates[Map[#[[n]] &, Select[bs, Length[#] > n - 1 &]]], {n, 11}]
%t A258241 paths = Sort[Map[Reverse[b[#]] &, Last[generations]]]
%t A258241 graph = DeleteDuplicates[Flatten[Map[Thread[Most[#] -> Rest[#]] &, paths]]]
%t A258241 TreePlot[graph, Top, 0, VertexLabeling -> True, ImageSize -> 700]
%t A258241 Map[DeleteDuplicates, Transpose[paths]] (* _Peter J. C. Moses_,May 21 2015 *)
%Y A258241 Cf. A022838, A258242 (path-length, 0 to n), A258212
%K A258241 nonn,tabf,easy
%O A258241 1,3
%A A258241 _Clark Kimberling_, Jun 05 2015