# Not the division algorithm (but fairly similar)

• Aug 2nd 2008, 11:13 AM
Sigyn3
Not the division algorithm (but fairly similar)
Prove that for any positive integer $\displaystyle n$, there exist unique positive integers $\displaystyle k$ and $\displaystyle r$ such that $\displaystyle n = \frac{k(k-1)}{2}+r$ with $\displaystyle 1\le r\le k$.
• Aug 2nd 2008, 05:39 PM
ThePerfectHacker
Quote:

Originally Posted by Sigyn3
Prove that for any positive integer $\displaystyle n$, there exist unique positive integers $\displaystyle k$ and $\displaystyle r$ such that $\displaystyle n = \frac{k(k-1)}{2}+r$ with $\displaystyle 1\le r\le k$.

Consider the set $\displaystyle \{ n - \tfrac{x(x-1)}{2}\geq 0 | x\in \mathbb{Z}^+ \}$. There exists a smallest integer $\displaystyle n - \tfrac{k(k-1)}{2} = r$. We claim that $\displaystyle r\leq k$. Assume not, then $\displaystyle r>k$ and we can write $\displaystyle r=r_0+k$ where $\displaystyle r_0<r$. Thus, we have $\displaystyle n - \tfrac{k(k-1)}{2} = r_0+k$ which gives $\displaystyle n-\tfrac{(k+1)k}{2} = r_0$. And this is a contradiction since $\displaystyle r$ was supposed to be minimal.
• Aug 2nd 2008, 06:10 PM
Sigyn3
Does this also prove uniqueness?