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.
Incorrect large number calculation was my problem too. But when I found the solution, I was surprised how simple it was.
Anyone came up with a working solution for this? I'm also puzzled as to why the formula works for smaller numbers, but doesn't work for the big ones.
Even when specifying int. I also found that the formula breaks at exactly 16th digit. I.E. the first 16 digits are always correct.
EDIT: I finally have an answer. The thing is, even when I specify int(), python still converts to float when dividing. Naturally, changing all divisions to floor divisions (//) solved the problem.
Hello, all, I had this problem too. Even with a formula and after I forced it to be written with integers...
170970902404966449586247098818855152577703936966215095276168985530690669141903684897 should equal 170970902404966462328920047488181969596690166234976092377640121561715772973645152611
I really have no idea what happened and what I can do.
Please use spoiler flag next time.
I've tested 2 solutions and it work so I guess the code you made is a bit sub-optimal or run in loop.
Even I'm getting the same thing as yours.
Did you solve it?
Thanks for that insight. I mistakenly believed that math.floor and math.ceil would return integers.
X4 having the same problem. My formula works for smaller values but the final test case gives the following error:
170970902404966449586247098818855152577703936966215095276168985530690669141903684898 should equal
170970902404966462328920047488181969596690166234976092377640121561715772973645152611
does something happen when the numbers become really large? I can't see why it should be inaccurate for this value yet correct for the others
Update: not sure if it will help others but making sure that only type'int' was in the equation solved my large number inaccuracy. Best of luck everyone
IshaanKapoor x3
Sizes ranging from 5 to 10 are given as examples. My formula works for all of those sizes and even numbers that are considerably larger. But when it gets to the crazy large numbers, suddenly the formula doesn't fit. I don't understand how the formula stops working above some unknown threshold size. Maybe it's something about enormous spiral sizes that I don't know.
ishaanKapoor x2
It's much easier than you think. Just observe the pattern!