Ad
  • Custom User Avatar

    Don't knock your approach just yet. I think we're using the same one, and Javascript's precision craps out around n = 43. Your math is probably fine.

    I'm going to try in Python to verify.

    Edit: Somewhat verified in Python. It works with n = 47, but the python built-in test cases only go to 20, and I'm not willing to build out all the real answers from Wolfram|Alpha to make my own test suite to 200.