login
Triangle T(n, k), read by rows 1<=n, 1<=k<=n: Number of cells touched by a unit-width diagonal in a regular n X k grid.
2

%I #9 May 24 2024 13:41:41

%S 1,2,4,3,6,7,4,8,10,10,5,8,11,14,13,6,10,14,14,16,16,7,12,13,16,19,20,

%T 19,8,14,16,20,20,22,24,22,9,14,17,18,21,22,25,28,25,10,16,20,20,26,

%U 24,28,30,30,28,11,18,21,22,25,26,29,30,33,34,31

%N Triangle T(n, k), read by rows 1<=n, 1<=k<=n: Number of cells touched by a unit-width diagonal in a regular n X k grid.

%D J. D. E. Konhauser, D. J. Velleman and S. Wagon, Which Way Did the Bicycle Go?, Cambridge University Press, 1996, page 179.

%H Andrew Woods, <a href="/A226246/b226246.txt">Table of n, a(n) for n = 1..5050</a>

%F Let g := gcd(n,k), r := sqrt(n*n+k*k)/2.

%F T(n,k) = n+k+g+2*(g*floor(r/g)-floor(r/min(n,k))-1).

%e 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.

%Y The zero-width case is A199408 (or A074712).

%K nonn,tabl

%O 1,2

%A _Andrew Woods_, Jun 01 2013