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.

A258245 Irregular triangle (Beatty tree for Pi) as determined in Comments; a permutation of the nonnegative integers.

This page as a plain text file.
%I A258245 #4 Jun 11 2015 10:36:14
%S A258245 0,3,1,12,6,4,40,2,15,21,13,128,5,7,9,43,50,69,41,405,25,31,14,16,18,
%T A258245 22,131,138,160,219,129,1275,8,10,53,59,72,81,100,42,44,47,51,70,408,
%U A258245 414,436,505,691,406,4008,34,17,19,23,26,28,32,141,150,163,169
%N A258245 Irregular triangle (Beatty tree for Pi) as determined in Comments; a permutation of the nonnegative integers.
%C A258245 The Beatty tree for an irrational number r > 1 (such as r = Pi), is formed as follows.  To begin, let s = r/(r-1), so that the sequences defined 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 A258245 The tree T has root 0 with an edge to 3, 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 A258245 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 A258245 See A258212 for a guide to Beatty trees for various choices of r.
%e A258245 Rows (or generations, or levels) of T:
%e A258245 0
%e A258245 3
%e A258245 1   12
%e A258245 6   4   40
%e A258245 2   21  15   13   128
%e A258245 9   7   69   5    50   43   42   405
%e A258245 31  25  22   219  18   16   160  14   138   131   129   1275
%e A258245 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,21,7,25,8).  The path obtained by backtracking (i.e., successive applications of the mapping b in Comments) is (8,25,7,21,6,1,3,0).
%t A258245 r = Pi; k = 2000; w = Map[Floor[r #] &, Range[k]];
%t A258245 f[x_] := f[x] = If[MemberQ[w, x], Floor[x/r], Floor[r*x]];
%t A258245 b := NestWhileList[f, #, ! # == 0 &] &;
%t A258245 bs = Map[Reverse, Table[b[n], {n, 0, k}]];
%t A258245 generations = Table[DeleteDuplicates[Map[#[[n]] &, Select[bs, Length[#] > n - 1 &]]], {n, 8}]
%t A258245 paths = Sort[Map[Reverse[b[#]] &, Last[generations]]]
%t A258245 graph = DeleteDuplicates[Flatten[Map[Thread[Most[#] -> Rest[#]] &, paths]]]
%t A258245 TreePlot[graph, Top, 0, VertexLabeling -> True, ImageSize -> 800]
%t A258245 Map[DeleteDuplicates, Transpose[paths]] (* _Peter J. C. Moses_,May 21 2015 *)
%Y A258245 Cf. A022844, A258244 (path-length, 0 to n), A258212.
%K A258245 nonn,tabf,easy
%O A258245 1,2
%A A258245 _Clark Kimberling_, Jun 08 2015