OFFSET
1,2
COMMENTS
Running bond pattern: the tiles form horizontal rows and for all i (row number), row i+1 is row i translated by vector (1/2, 1). The first row is supposed to contain the tile with bottom-left vertex (0,0). A tile is considered crossed if its interior intersects the line segment (0,0) -- (n,k).
EXAMPLE
T(3,5) = 5 because (0,0) -- (3,5) crosses the following tiles, identified by their bottom-left vertices: (0,0), (0.5,1), (1,2), (1.5,3), (2,4).
T(5,3) = 6 because (0,0) -- (5,3) crosses the following tiles, identified by their bottom-left vertices: (0,0), (1,0), (1.5,1), (2.5,1), (3,2), (4,2).
MATHEMATICA
F[a_, b_, p_, q_, i_] :=
Block[{x0, x1, d}, x0 = (p/q - a/b)*i; x1 = x0 + p/q;
d = Floor[x1] - Floor[x0]; If[IntegerQ[x1], d, d + 1]];
FF[a_, b_, p_, q_] := Sum[F[a, b, p, q, i], {i, 0, q - 1}];
a = 1; b = 2;
Table[FF[a, b, p, s - p], {s, 2, 13}, {p, 1, s - 1}] // Flatten
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Luc Rousseau, Sep 16 2017
STATUS
approved