OFFSET
1,2
COMMENTS
A diagonal of an n by k rectangle drawn on a square grid passes through T(n,k) squares: the diagonal enters n squares crossing horizontal segments and enters k squares crossing vertical segments. Gcd(n,k) counts the squares entered at a lattice point, which have been over-counted.
REFERENCES
M. Ollerton, Mathematics Teacher's Handbook, Continuum, 2009, pp. 14-15.
LINKS
Seiichi Manyama, Rows n = 1..140, flattened
Association of Teachers of Mathematics, Points of Departure 1, Derby, 1972.
FORMULA
T(d*a,d*b) = d*T(a,b).
EXAMPLE
T(6,4) = 6 + 4 - 2 = 8.
Triangular array begins
1
2 2
3 4 3
4 4 6 4
5 6 7 8 5
6 6 6 8 10 6
7 8 9 10 11 12 7
8 8 10 8 12 12 14 8
PROG
(PARI) T(n, k) = n + k - gcd(n, k); \\ Michel Marcus, Aug 04 2018
CROSSREFS
KEYWORD
AUTHOR
Brian Hopkins, Nov 05 2011
STATUS
approved