Post Reply 
another interesting math riddle
01-13-2018, 10:03 AM
Post: #5
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.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
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 - Gamo - 01-14-2018, 10:22 AM



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