# Puzzles

## Square and cube endings

Source: UKMT 2011 Senior Kangaroo

How many positive two-digit numbers are there whose square and cube both end in the same digit?

#### Show answer & extension

#### Hide answer & extension

Only the units digit of the number will affect the last digit of the square and cube. This table shows how the last digits of the square and cube depend on the last digit of the number:

Last digit of... |

number | square | cube |

0 | 0 | 0 |

1 | 1 | 1 |

2 | 4 | 8 |

3 | 9 | 7 |

4 | 6 | 4 |

5 | 5 | 5 |

6 | 6 | 6 |

7 | 9 | 3 |

8 | 4 | 2 |

9 | 1 | 9 |

So numbers ending in 0, 1, 5 and 6 will have squares and cubes that end in the same digit. There are 4×9=**36** two-digit numbers then end in one of these digits.

#### Extension

How many two-digit numbers are there in binary whose square and cube end in the same digit?

How many two-digit numbers are there in ternary whose square and cube end in the same digit?

How many two-digit numbers are there in base \(n\) whose square and cube end in the same digit?