“Look,” said the student, “we all know how this goes down. A nasty-looking fraction comes out of the sum, I reach for the calculator, you commit some act of exaggerated violence and tell me how you, o wondrous one, can do it in your head.”

“You’re not as dumb as you look,” retorted the Mathematical Ninja. “So what is $\frac {8}{19}$?”

“Well, uh, ah, a bit less than a half. A bit more than two-fifths. Somewhere in the low 0.4s?”

The Mathematical Ninja cocked their head. Not bad, they thought, but they weren’t about to say that aloud. “I think you’ll find it’s $0.\dot 42105263157894736\dot8$.”

“I mean, I’ll take my answer,” said the student, “but I’m curious about how you got yours.”

“I thought you’d never ask! Since $\frac 8{19} = \frac{0.4}{1-0.05}$, you can use the binomial expansion to write it as $0.4\left( 1 + 0.05 + 0.05^2 + …\right)$.”

“I find it hard to believe you computed that in your head.”

“No, I took a shortcut. The first (working) pair of digits are 0.40. The next ‘pair’ are five times that, 200, so with the carry, that’s 0.4200.”

“Then 1000, giving you 0.421000, and 5000, making 0.42105000. That still seems like a lot to keep track of.”

“It would be. But I took a short cut. If you know the pattern for this kind of fraction, you can anticipate the carry. If your pair of digits is below 20, you don’t carry; between 20 and 39, you add 1…”

“And for something like 40, you’d add 2 to get 42.”

“You’ve got it. Then when you multiply by 5, you can just look at the remainder modulo 20.”

“So the next one is $2 \times 5$, which is…” the student mimed reaching for the calculator, and earned a dirty look. “Ten, then 50, which becomes 52; then 60 into 63, 15 into 78, 18 into 94, then 73, 68, and we’re back to 42 again, which must be where it recurs!”


“Are there similar tricks for other numbers?”

“There may be.”

* Thanks to Chris Smith for reminding me about 19ths. * Edited 2019-08-22 to correct pronouns.