OFFSET
1,5
COMMENTS
Enumerate all rational numbers q in [0,1) with denominator <= n. T(n,k) is the number of these with floor(n*q) = k-1. Problem suggested by David W. Wilson.
EXAMPLE
T(6,3) = 2; the sequences for n=6, k=3 are 0,2,4 and 0,2,5. The sequence 0,1,3 is not counted because the next term of a Beatty sequence beginning 0,1,3 must be 4 or 5, so 0,1,3 is not a Beatty sequence truncated to numbers less than 6.
MATHEMATICA
Flatten@Table[Count[Select[Union@Flatten@Outer[Divide, Range[n + 1] - 1, Range[n]] , # <= 1 &], _?(Floor[n #] == k &)], {n, 12}, {k, n}] (* Birkas Gyorgy *)
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Franklin T. Adams-Watters, Oct 20 2006
STATUS
approved