# The Mathematical Ninja And The Cubes

The Mathematical Ninja glanced at the Rubik Cube and paused.

“And $45^3$ is…” A reach for the calculator. A flurry of colour. “Ow!”

“91,125,” said the Mathematical Ninja, catching the cube on the rebound and swizzling it solved. “Only needed 12 that time.”

The student sighed. “Go on, then. I bet there’s a trick.”

“Of course there’s a trick to cube a number ending in five. Let’s call it $(10n + 5)$.”

“Yes,” said the student, rubbing his hand. “Let’s.”

“Work out $\frac{n(n+1)(2n+1)}{2}$ – that’s to say, multiply the number of tens either side of your number and their sum.”

“Hold on… so you did $4 \times 5 \times 9$ and halved it?”

“Well, I halved four and did $2 \times 5 \times 9$, but yes. Then I worked out a carry – how many 40s are in 45?”

“One and a bit.”

“Carry one, then, to make it 91. That’s the thousands.”

“And the rest of it?”

“The last part cycles through 125, 375, 625 and 875…”

“Like the eighths!” said the student, brightly.

“Just like the eighths,” agreed the Mathematical Ninja. “It’s almost as if they’re related. In this case, $n \pmod 4 = 0$, so it’s the first of them, and the answer is 91,125.”

“I want to play!” said the student. “Can I do 145?”

“Do whichever number gives you the greatest pleasure,” said the Mathematical Ninja.

“So I need to do $14 \times 15 \times 29$ and divide it all by 2?”

“Mhm.” The Mathematical Ninja was scrambling the Rubik Cube again.

“Well, fourteen fifteens are 210. Twenty-one twenty-nines are $25^2 - 16 = 609$, so the top is 6,090. Halve it, 3,045. Carry three, 3,048. And we need 625 on the end.”

“Booya!” said the Mathematical Ninja, *sotto voce*.

* Edited 2016-10-17 to play the pronoun game.