Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Ok, thx! Learned something today!
I can't seem to get my code through the fourth submit test for python, although the given output is exactly the same as what is requested. Could you have a look at that?
As a comment on my solution I explained how this problem can be solved without going through the entire series from i = 1 to n, just by applying a limited amount of equations. This results in a solution which needs less calculation power (I got around 2300 ms when going through the series, and around 1400 ms with the 'optimized solution'.) As you gave the suggestion to optimize the solution, this problem would just get that extra edge, and increase the difficulty slightly, if such an optimized solution was actually needed in order to fulfill the kata.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
The test would be more supportive if it would print what was given as a test if it failed. Further, just in my opinion, a book starts at page 1, and not page 0.
As a matter of fact, you don't need to analyse beyond the square root of the given integer. In that case, just add the result of the division as well (if it is not the same, at least). I would propose to test quite large numbers as well, in order to demand more efficient code for large numbers.