In the coordinate plane, a lattice point is a point with integer coordinates. Suppose n is a positive integer. How many lattice points (x,y) are there such that (x,y) lies in the region defined by the inequalities 0<=x<=n, 0<=y<=n, and |x-y| <=1?
The region defined by the inequalities is a diamond with side length n+1. The number of lattice points in a square with side length n is n^2, so the number of lattice points in a diamond with side length n+1 is ((n+1)^2−n^2)/2 = n^2 + n.