OFFSET
1,2
REFERENCES
J. D. E. Konhauser, D. J. Velleman and S. Wagon, Which Way Did the Bicycle Go?, Cambridge University Press, 1996, page 179.
LINKS
Andrew Woods, Table of n, a(n) for n = 1..5050
FORMULA
Let g := gcd(n,k), r := sqrt(n*n+k*k)/2.
T(n,k) = n+k+g+2*(g*floor(r/g)-floor(r/min(n,k))-1).
EXAMPLE
A paintbrush of unit width is dragged centrally along the diagonal of a rectangular 5 X 7 grid. The number of squares in the grid which contain paint in their interiors is T(5,7) = 19.
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Andrew Woods, Jun 01 2013
STATUS
approved