another interesting math riddle
01-13-2018, 10:03 AM
Post: #5
 Didier Lachieze Senior Member Posts: 1,449 Joined: Dec 2013
RE: another interesting math riddle
To find a limit to the numbers that could meet the criteria, we can compare the number of digits of a number to the number of digits of the maximum sum of its digits factorials.

On the Prime in the sequence app, entering U1(N)= CEILING(LOG(9!*N))-N and going to the NUM view tells us that any number with more 7 digits cannot meet the criteria as it is superior to the maximum sum of its digits factorials (9!*8 has only 7 digits and is lower than any 8-digit number) and that for 7 digit numbers only the ones below 9!*7 (2540160) are candidates.

So the following program returns all possible solutions :
Code:
EXPORT TST() BEGIN  LOCAL n,r:={};  FOR n FROM 1 TO 9!*7 DO   IF ΣLIST((ASC(STRING(n))-48)!)==n THEN r(0):=n END;  END;  RETURN r; END;

On my Prime rev C with the Beta 3 firmware it returns {1,2,145,40585} after 16'21".

There may be smarter and faster ways to check for all possible solutions.
 « Next Oldest | Next Newest »

 Messages In This Thread another interesting math riddle - Don Shepherd - 01-13-2018, 01:37 AM RE: another interesting math riddle - Gerson W. Barbosa - 01-13-2018, 02:04 AM RE: another interesting math riddle - Joe Horn - 01-13-2018, 06:02 AM RE: another interesting math riddle - Don Shepherd - 01-13-2018, 06:14 AM RE: another interesting math riddle - SlideRule - 01-13-2018, 12:47 PM RE: another interesting math riddle - Don Shepherd - 01-13-2018, 03:34 PM RE: another interesting math riddle - Didier Lachieze - 01-13-2018 10:03 AM RE: another interesting math riddle - olr - 01-13-2018, 09:08 PM RE: another interesting math riddle - Didier Lachieze - 01-13-2018, 10:29 PM RE: another interesting math riddle - Didier Lachieze - 01-17-2018, 11:59 PM RE: another interesting math riddle - Joe Horn - 01-14-2018, 07:10 AM RE: another interesting math riddle - SlideRule - 01-13-2018, 05:28 PM RE: another interesting math riddle - Gamo - 01-14-2018, 10:22 AM RE: another interesting math riddle - grsbanks - 01-14-2018, 10:44 AM

User(s) browsing this thread: 1 Guest(s)