programming puzzles?

Paul Rubin http
Sat Apr 8 23:30:25 EDT 2006


"Michael Tobis" <mtobis at gmail.com> writes:
> The first piece of code that I ever voluntarily wrote was intended to
> solve this puzzle:
> 
> Assign the number 2 to 'a', 3 to 'b' ... 27 to 'z'. To each word assign
> the value of the product of its characters. Find the English (or
> language of your choice) word whose product is closest to a million (or
> number of your choice).

Hey, that was a contest in Games Magazine in the 1980's.  A co-worker
and I used a PDP-10 BASIC program to search for numbers near 1 million
with no prime factors higher than 27.  The factorizations of those
numbers told us which letters to try to use, and after a while of
fooling around rearranging letters on a whiteboard, we came up with
"curvy", a very recognizable word that multiplies out to 999,856.

That's the closest number to 1 million (other than 1 million itself)
which doesn't have any prime factors that are too large.  We convinced
ourselves that there was no word that multiplied to exactly 1 million,
so we felt we were likely to win the contest.  However, somebody
apparently with a computerized word list won with "ixodid".  It was
fun to remember this.



More information about the Python-list mailing list