triangles in a grid of $n\times n$ with positive coordinates

135 Views Asked by At

I need to count the number of triangles formed in a grid of $n\times n$ with positive integer coordinates $(0..n)$. For example for $n = 1$ the answer is 4.