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$?

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy