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.
You accidentally edited the edge cases to have a space.
This comment is hidden because it contains spoiler information about the solution
This solution does not work anymore due to comparing a float with an integer of large size.
You can avoid this by removing the division on the left side and multiplying the right side by 4 instead.
You are trying to write to a variable outside the scope of your function with p0 += something.
(It's bad practice to use functions to edit variables outside of your function to begin with most of the time)
By declaring pop you have a variable you can write to and do what you want with inside your function.
Nevermind what I said
Why the +0.005 to my final answer you ask?
The answer: floating point arithmetic sucks, it's a work-around for rounding errors.
Unfortunately I do not know of any way to get rid of this, if anyone can fork this and provide a proper answer that would be nice.
And yes for the series f(x) = a * f(x-1) + b the general solution for x finding value Q:
log_a((Q+b/(a-1))/(f(0)+b/(a-1))) Maths baby