# Math Help - Not the division algorithm (but fairly similar)

1. ## Not the division algorithm (but fairly similar)

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

2. Originally Posted by Sigyn3
Prove that for any positive integer $n$, there exist unique positive integers $k$ and $r$ such that $n = \frac{k(k-1)}{2}+r$ with $1\le r\le k$.
Consider the set $\{ n - \tfrac{x(x-1)}{2}\geq 0 | x\in \mathbb{Z}^+ \}$. There exists a smallest integer $n - \tfrac{k(k-1)}{2} = r$. We claim that $r\leq k$. Assume not, then $r>k$ and we can write $r=r_0+k$ where $r_0. Thus, we have $n - \tfrac{k(k-1)}{2} = r_0+k$ which gives $n-\tfrac{(k+1)k}{2} = r_0$. And this is a contradiction since $r$ was supposed to be minimal.

3. Does this also prove uniqueness?