0
Why was my post wrong?
print((0.01*((2**30)-1))/(2-1)) result 10737418.23 not true. True result is 10737418.24. I don't know post image
5 Réponses
+ 1
Spiders 🕷 Man
This is the equation of geometric sequence right?
An = A1*r**(n-1)
Yes you are right. This is the original equation:
print(0.01*(2**(31-1))
The reason why 31 is the last term is because the challenge is asking for the total cost AFTER 30 days which means the last term is 31. So it is the same anyway. And I think you placed the minus 1 outside the equation instead of the last term on your first code.
I hope this helps.
+ 2
Try this:
print(0.01*(2**30))
Update me if it still not working . If it works, allow me to explain. Thanks!
+ 2
1. In the challenge or problem, the exponent(30) represents the number of days so you dont need to Subtract 1 into it.
2. Divide by (2/1) is very unnecesary cause it will be equal to 1 or 1.0 anyway. (Any number that is divided by 1 will be the number itself as a result)
3. 2/1 == 1.0, this float number may be the reason why the answer is off by 1 decimal.
+ 2
I use A geometric series
+ 1
Thanks. Can you tell me Why was my post wrong?