# Square remainders

N | N^{2} | rem |
N | N^{2} | rem |

1 | 1 | 1 | 7 | 49 | 1 |

2 | 4 | 4 | 8 | 64 | 4 |

3 | 9 | 9 | 9 | 81 | 9 |

4 | 16 | 4 | 10 | 100 | 4 |

5 | 25 | 1 | 11 | 121 | 1 |

6 | 36 | 0 | 12 | 144 | 0 |

### "All squares, on division by twelve, leave a remainder which is also a
square."

**rem** = remainder mod twelve

The statement is also true, by the way, if we replace the word
"twelve" by "five", "sixteen", or "twenty-four".

Can you find other solutions?

# Quick Squares

(NB "10" means any number base)

### A handy rule for squaring numbers

(mental, or pencil & paper)

- Find the difference, "d" between the number, "n", and the next multiple of "10" (above or below n)
- If you needed to add the difference, d, to get the multiple, also form the
number n-d;

if you needed to subtract the difference, also form the number n+d.
- Multiply these numbers (n+d) and (n-d) and then add the square of
the difference, d
^{2}, to this answer.

Which says that: n^{2} = (n-d)(n+d) + d^{2}

Here are some examples in numbers:

- (base ten)

n = "38"; next multiple of 10 is 38+2, i.e. 40; this is n+d, so d = 2

also form n-d: 38 - 2 = 36.

Square of 38 is 36 x 40 + 2^{2} = 1440+4 = 1444
- (base seven)

n = "36" ; next multiple is 40, or 36 + 1

also form 36 - 1 = 35.

Square of 36 is 35 x 40 + 1^{2} = 2060 + 1 = 2061.
- (any base greater than 4)

n = "12" ; nearest multiple is 10, or 12 - 2;

also form 12 + 2 = 14.

Square of 12 is 14 x 10 + 2^{2} = 140 + 4 = 144

And the proof? [ (n-d)(n+d) ] +d^{2} =[ n^{2} -nd +nd + d^{2} ] + d^{2}

= [n^{2} - d^{2}] + d^{2} = n^{2}.