Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In mid-1997 I was about to enter grade 12, and getting my first experience with C -- writing code to compute the 5 trillionth bit of Pi (yes, I believe in jumping in at the deep end).


Do you remember what it was?

If I recall correctly, computing hex digits of pi is fairly trivial, but decimal digits are not. Is that right?


The 5 trillionth bit of Pi is zero.

computing hex digits of pi is fairly trivial, but decimal digits are not

For some definition of "fairly trivial", yes.

The Nth hexadecimal (or binary) digit of Pi can be computed in O(log N) space and O(N (log N)^2 log log N) time, while the best known algorithm for computing the Nth decimal digit requires O(N) space and O(N (log N)^2) time. This is due to Pi being expressible as a polylogarithm ladder in base 1/2 but not in base 1/10 (as far as we know).




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

Search: