Solve this alphametic, where each of the capital letters in bold represents a different decimal digit from 0 to 9. None of the numbers contains any leading zero.
(TO)! = (KNOW)*(TITANS)
A table of factorials from 10 to 16 is:
10 3628800
11 39916800
12 479001600
13 6227020800
14 87178291200
15 1307674368000
16 20922789888000
(TO)! should come out to nine or ten digits so as to be the product of a four-digit number times a six-digit number, so TO is either 12 or 13.
The following program merely checks possible four-digit divisors of TO! where the third digit matches the units digit of TO and the quotient has six digits starting with a 1. Variable Ton is used for TO, as TO is a reserved word.
10 for Ton=12 to 13
20 for Dvr=1234 to 9876
25 if int(Dvr/10)@10=Ton@10 then
30 :Q=!(Ton)//Dvr
40 :if Q=int(Q) and Q>99999 and Q<200000 then print Ton,Dvr,Q
50 next
60 next
The list produced is:
12 2520 190080
12 3024 158400
12 3520 136080
12 4224 113400
12 4320 110880
12 4620 103680
12 4725 101376
of which only the last row fits the pattern:
12! = 4725 * 101376
|
Posted by Charlie
on 2009-06-14 13:22:55 |