another interesting math riddle
|
01-13-2018, 09:08 PM
Post: #9
|
|||
|
|||
RE: another interesting math riddle
(01-13-2018 10:03 AM)Didier Lachieze Wrote: On my Prime rev C with the Beta 3 firmware it returns {1,2,145,40585} after 16'21". Another approach is to go through all sorted lists containing up to 7 digits, calculate the "factorial sum" of the digits and compare the digits of the sum with those in the list. There are \( \sum_{j=1}^7 \binom{9+j}{j} = 19447 \) sorted lists with up to 7 digits. Hence only 19447 possibilities need to be checked (and not 2540160). If we additionally take into account that at least three (of seven) digits need to be 9s in order to get a 7-digit factorial sum ( \( 5\cdot 8!+2\cdot 9! = 927360 \) ), the number of sorted lists with seven digits decreases from 11440 down to 715. Therfore only a total of 8722 possibilities need to be checked. The following program returns the result in 9 seconds on my Prime rev A (in 19 seconds if the 7-digit optimization is removed). Code:
|
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 6 Guest(s)