Hacker News new | past | comments | ask | show | jobs | submit login

The closed form solution isn't O(1). It's Ω(2^N) since the number of digits in the output is Θ(2^N).



On the most prevalent electronic computers of our time the closed form solution is effectively constant-time if the output is bounded to be within the limits of a 32 or 64 bit integer.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: