Hacker News new | ask | show | jobs
by dahart 3084 days ago
Long division is hard to do in your head, but to determine if a number is a factor, there's a technique in between long division and memorizing a graph walk that is probably easier to do mentally that either one (since you don't have to memorize a graph for each divisor). With "modulo division" you can calculate a running remainder in your head while consuming one digit at a time of the dividend, from left to right. It gets pretty easy with just a little practice. https://en.m.wikipedia.org/wiki/Short_division#Modulo_divisi...

The division by subtraction is fairly well known, of course, but it reminds me of the surprising square root by subtraction that I only learned about recently. It's probably too much to do mentally, but easy with pencil & paper.

To compute the digits of the square root of n, set a = 5n, b = 5. Repeat: if a≥b, set a=a-b, add 10 to b. Then if a<b, add two zeroes to a, and add a zero to b just before the final digit (which will always be ‘5’).

I had to code it up myself just to believe it would work. http://www.afjarvis.staff.shef.ac.uk/maths/jarvisspec02.pdf

2 comments

The "square root by subtraction" seems like the same algorithm that can be "implemented" by hand relatively easily on early mechanical calculators:

https://www.youtube.com/watch?v=K_c9-Y1ouww

What is this thing?? I totally have no use for it, and still I want one.

I'm very not sure what it's doing, but it looks like a different algorithm to me; there are a surprising number of square root techniques. https://en.m.wikipedia.org/wiki/Methods_of_computing_square_...

ReCurta: Our goal is to build the first Curta calculator since 1972 | https://news.ycombinator.com/item?id=16035091
There's no graph-memorising in the linked method. Modulo division looks pretty good though.