Joe Ganley
Writing code since 1979
I have been a professional software engineer for over 10 years. I have written many kinds of software, but my particular strengths are interactive graphics applications, compilers and interpreters, and algorithms.

I also enjoy writing, woodworking, and home improvement. Also this.

Resumé

Email Me

Atom Feed

not from a security camera

 

 

Tuesday, May 04, 2004


My mother sent me another of those
"guess your number" tricks, but this one was a little less obvious than they usually are. The way this one works is that the result of subtracting a number from its scramble is always divisible by 9, and thus the sum of its digits is a multiple of 9. So, when you enter your number with one digit removed, it computes the sum of the digits you entered and subtracts that from the next higher multiple of 9 (which must be the sum of the digits in your original number) to get the digit you removed. That is why it forbids you from picking 0, as otherwise when the sum of the digits you entered was an even multiple of 9, it wouldn't be able to distinguish whether the digit you removed was 0 or 9.

| permalink

Comments: Post a Comment


This page is powered by Blogger. Isn't yours?

Features
The Long Now Foundation
The Long Now Foundation

Man-Bag Buying Guide
Man-Bag Buying Guide

Copyright (c) 1988-2004 by Joseph L. Ganley. All rights reserved except where otherwise noted.