A292421 Square array T(n,k) = number of tiles crossed by the line segment (0,0) -- (n,k) in a running bond pattern tiling with square tiles, read by antidiagonals.
1, 2, 2, 4, 3, 3, 4, 3, 4, 4, 5, 4, 4, 5, 5, 6, 8, 6, 7, 6, 6, 8, 7, 5, 6, 6, 7, 7, 8, 9, 6, 8, 8, 7, 8, 8, 9, 8, 12, 9, 7, 8, 10, 9, 9, 10, 10, 10, 7, 10, 10, 10, 9, 10, 10, 12, 11, 11, 8, 10, 9, 13, 10, 10, 11, 11, 12, 11, 12, 16, 12, 11, 12, 10, 12, 13, 12, 12
Offset: 1
Examples
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).
Crossrefs
Cf. A074712.
Programs
-
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
Comments