# Help in Understanding the Formula for The Lattice Point Counting in Triangles with Rational Coordinates

Yesterday I have found this paper while searching Google. However, since the author of this paper gave no examples of implementing the following formula, I don't understand how to implement it in practical cases. The relevant part of the paper is quoted below,

## Algorithm for Triangle

...

Definition 2

Let $a$ , $b$ and $c$ be positive integers. We define the right-angled triangle $T(a,b,c)$ as follows: $$T(a,b,c)=\{(x,y)\in \mathbb{R}^2 \mid ax+by \leq c,x>0,y>0\}$$

Definition 3

Let $a$ , $b$ and $c$ be positive integers. We define $N(a,b,c)$ as the number of lattice points in the triangle $T(a,b,c)$.

...

Lemma 5

Let $a$ , $b$ and $c$ be positive integers with $a>b$. Let $m=\left \lfloor \dfrac{c}{a} \right \rfloor$, $h=\dfrac{(c-am)}{b}$ and $c'=c-b \left (km+\left \lfloor h \right \rfloor \right)$. Then the following equation holds, $$N(a,b,c)=N(a-bk,b,c)+\dfrac{km(m-1)}{2}+m\left \lfloor h \right \rfloor$$

Can anyone give example(s) of the implementation of the above formula as represented in lemma 5? It will be very much helpful for me. Also, I don't understand why there is the requirement of $a$, $b$ and $c$ being positive integers. What problem would arise if we just assume that $a$, $b$ and $c$ are non-negative with at most one of them being $0$?

• Could you include here the formula or statement in question? – Travis Willse Sep 23 '14 at 13:13
• And can you re-tag to indicate the area of mathematics we're talking about? and edit in a more informative title? – Gerry Myerson Sep 23 '14 at 13:23