237 B
237 B
Here I was desperately in need of an efficient algorithm. So I copied this one from mathblog.dk and translated it into befunge. And I have to say it's amazingly fast.