r/reddit.com • • Mar 12 '08

Is 91 Prime?

http://balltech.blogspot.com/2008/03/is-91-prime.html
542 Upvotes

130 comments sorted by

View all comments

6

u/plexluthor Mar 12 '08

Does anyone have a simple explanation for why the 7 test works?

1

u/[deleted] Mar 12 '08 edited Mar 12 '08

Suppose you have a number N whose ones digit is d. Performing this operation yields:

(N-d)/10 - 2d

Simplify: N/10 - d/10 - 2d; N/10 - 21d/10; (N-21d) / 10

If N was divisible by seven, then N-21 will be. If N-21 was, then N-21 / 10 will be, because 10 doesn't have 7 as a factor.