cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A226246 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.

Original entry on oeis.org

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, 19, 8, 14, 16, 20, 20, 22, 24, 22, 9, 14, 17, 18, 21, 22, 25, 28, 25, 10, 16, 20, 20, 26, 24, 28, 30, 30, 28, 11, 18, 21, 22, 25, 26, 29, 30, 33, 34, 31
Offset: 1

Views

Author

Andrew Woods, Jun 01 2013

Keywords

Examples

			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.
		

References

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

Crossrefs

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

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).