Your code appears to give the correct output for the failing tests - I’m not sure on this, but there may be something behind the scenes that stops your code from running through the tests if there’s too many calculations involved or something - for preventing infinite loops, and crashing your browser. Your code doesn’t have an infinite loop, but there’s probably a lot of calculations in those last two tests that may be triggering the testing to be stopped. Don’t quote me on this, I’m trying to find a post or something to confirm…
https://forum.freecodecamp.org/t/free-code-camp-infinite-loop-protection/19550
this post explains the problem, and gives a solution - however, I don’t think that solution works at the moment on the new website - I don’t know of any other quick solutions, you could try and make your algorithm faster to finish the tests within the time limit
Usually when you fail the test for the large numbers but it works elsewhere (like it does in codepen) that means that it is timing out before you can get the answer. The testing has a built in time limit. This means that you have to make your code more efficient. This is a common issue in programming. Try to find ways to maker your algorithm more efficient.