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.

A199408 Triangle T(n,k) = n + k - gcd(n,k) read by rows, 1 <= n, 1 <= k <= n.

Original entry on oeis.org

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, 9, 10, 9, 12, 13, 12, 15, 16, 9, 10, 10, 12, 12, 10, 14, 16, 16, 18, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 11, 12, 12, 12, 12, 16, 12
Offset: 1

Views

Author

Brian Hopkins, Nov 05 2011

Keywords

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.

Examples

			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
		

References

  • M. Ollerton, Mathematics Teacher's Handbook, Continuum, 2009, pp. 14-15.

Crossrefs

Cf. A049627, A074712. Third column A061800.

Programs

Formula

T(d*a,d*b) = d*T(a,b).