From: Joe Horn on 23 Mar 2010 17:14 It would *seem* that all integers raised to the 4th power contain at least one digit less than 5. For example, 26 to the 4th power is 456976, which contains a 4. However, there does exist a positive integer X such that X^4 contains no digits less than 5. Mini-challenge: Write a User-RPL program that finds the only (?) positive integer X such that X^4 contains no digits less than 5. Winner: Fastest solver that doesn't cheat. -Joe- From: Han on 23 Mar 2010 18:53 On Mar 23, 5:14 pm, Joe Horn wrote:> It would *seem* that all integers raised to the 4th power contain at > least one digit less than 5.  For example, 26 to the 4th power is > 456976, which contains a 4.  However, there does exist a positive > integer X such that X^4 contains no digits less than 5. > > Mini-challenge: Write a User-RPL program that finds the only (?) > positive integer X such that X^4 contains no digits less than 5. > > Winner: Fastest solver that doesn't cheat. > > -Joe- Is this really a math problem at heart? or did you actually want a programming problem? The difference for me lies in whether or not we are supposed to (a) do a search for such an x versus (b) simply coming up with a method for determining if a given x satisfies the conditions above. Problem (a) is more of a mathematical problem. Assuming our program has to also verify that all smaller integers have "small" digits when raised to the power of 4, one can eliminate various classes of integers from the search. This knowledge would certainly produce a program that is faster than a program by someone who is not as familiar with properties of integers. Problem (b) is more of a programming problem, phrased in my mind as: how would one implement in User-RPL a routine that quickly determines if x^4 has a "small" digit? Perhaps you can clarify the problem by setting up what the expected input and output of the program should be. From: Virgil on 23 Mar 2010 19:02 In article , Joe Horn wrote: > It would *seem* that all integers raised to the 4th power contain at > least one digit less than 5. For example, 26 to the 4th power is > 456976, which contains a 4. However, there does exist a positive > integer X such that X^4 contains no digits less than 5. > > Mini-challenge: Write a User-RPL program that finds the only (?) > positive integer X such that X^4 contains no digits less than 5. > > Winner: Fastest solver that doesn't cheat. > > -Joe- Presuming that you have already found one such integer, do you have a proof that there cannot be more than oner? If not, I suggest that you ask for a program which finds the smallest such integer. From: Joe Horn on 23 Mar 2010 19:14 > Is this really a math problem at heart? or did you actually want a> programming problem? The mini-challenge is a programming one. The *implied* math challenge is far from mini, and probably belongs in a math newsgroup. > Perhaps you can clarify the problem by setting up what the expected > input and output of the program should be. Input: none; output: solution. Since the winner is determined by minimal runtime (the "fastest" program), optimizing the program is left up to the cleverness of the programer. Use programming tricks, and/or math tricks (e.g. number theory), whatever pleases you. Remember the #1 goal of mini-challenges is not to win but to have fun. If you are enjoying the journey, you're on the right path. Yes, you may quote me on that. ;-) The other usual rules apply: No embedded machine language; single standalone User RPL program only; yada yada yada. If breaking a rule leads to an interesting diversion, go for it. It's all about having fun. -Joe- From: Jim Horn on 23 Mar 2010 19:25 Well, Excel makes it easy to search manually, giving me 0xB34 in short order. I know, that doesn't count. Gotta keep my HP50g where I can get at it (or put a programming language on my work laptop). Where *do* you come up with these interesting problems, anywho? Jim (Why the Hex answer? Don't want to give it entirely away for those who want to solve it themselves)