A nine digit number has the property where the first digit equals the number of zeros and ones used in the number, the second digit equals the number of ones and twos used in the number, the third digit equals the number of twos and threes used in the number, etc. through the ninth digit equals the number of eights and nines used in the number. What could the number be?
A ten digit number has a similar property to the nine digit number. The first digit equals the number of zeros and ones used in the number, the second digit equals the number of ones and twos used in the number, etc. through the ninth digit. And also, the tenth digit equals the number of zeros and nines used in the number. What could this number be?
Ken,
My program (updated in the original post) now runs in 12 seconds on my desktop. Yours is running in 25 seconds. (Not sure why mine is now running about twice as fast as yours.)
My only changes were: "OPTIONS STRICT ON", and making the "number" variable global, so that it wasn't necessary to pass it to the subroutines with the BYREF keword. (Also a little change in the TimeOfDay handling.) Apparently my original program was using "late binding".
Thanks for showing me a much better way to do things.
Edited on September 24, 2005, 11:49 am
|
Posted by Penny
on 2005-09-24 11:42:59 |