Leftovers
Weekly Problem 26 - 2008
If $n$ is a positive integer, how many different values for the remainder are obtained when $n^2$ is divided by $n+4$?
      
    If $n$ is a positive integer, how many different values for the remainder are obtained when $n^2$ is divided by $n+4$?
Problem
As $n$ takes each positive integer value in turn (that is, $n=1$, $n=2$, $n=3$...) how many different values are obtained for the remainder when $n^2$ is divided by $n+4$?
 
If you liked this problem, here is an NRICH task which challenges you to use similar mathematical ideas.
Student Solutions
Answer: 9 different remainders (0, 1, 2, 3, 4, 5, 6, 7, 16)
| $n$ | $n^2$ | $n+4$ | remainder | 
|---|---|---|---|
| 1 | 1 | 5 | 1 | 
| 2 | 4 | 6 | 4 | 
| 3 | 9 | 7 | 2 | 
| 4 | 16 | 8 | 0 | 
| 5 | 25 | 9 | 7 | 
| 6 | 36 | 10 | 6 | 
| 7 | 49 | 11 | 5 | 
| ... | ... | ||
| Not much pattern so far | |||
| ... | ... | ||
| 20 | 400 | 24 | 24$\times$15 = 240 + 120 = 360 24$\times$16 = 360 + 24 = 384 remainder is 16  | 
| 100 | 10000 | 104 | 104$\times$100 = 10400 104$\times$96 = 10400 - 4016 = 10000 - 16 remainder is 16  | 
| 101 | 10201 | 105 | 105$\times$100 = 10500 105$\times$97 = 10500 - 315 = 10200 - 16 remainder is 16  | 
Remainder is 16 for the larger numbers tested
Had to multiply by $n-4$ for the larger values of $n$, try this algebraically: $(n-4)(n+4)=n^2-16$
So $n^2 = \underbrace{(n-4)(n+4)}_{\text{multiple of }n+4} + 16$
So the remainder is the same as the remainder when $16$ is divided by $n+4$
This will be $16$ if $n+4\gt16$ so if $n\gt12$.
Check values for $n=8$ to $n=12$ ($n$ up to $7$ shown above)
| $n$ | $n+4$ | remainder when $16$ divided by $n+4$ | 
|---|---|---|
| 8 | 12 | 4 | 
| 9 | 13 | 3 | 
| 10 | 14 | 2 | 
| 11 | 15 | 1 | 
| 12 | 16 | 0 |