Project Euler #254: Sums of Digit Factorials

  • + 0 comments

    I have a method that seems to correctly calculate g(n) for n > 63 very quickly (g(64) -> g(1000) in 0.005 sec) but for some reason from g(1) to g(63) its mostly incorrect.

    However, it seems like not even this method can work within the required time constraint for tests other than #0 and #1. I believe the numbers are not much bigger than g(150), but you must calculate lots of them, since q can get up to 10^5.

    I also implemented a semi-brute force method with DP, but I can only get through test #0.