User blog comment:Deedlit11/Bignum Bakeoff appetizer/@comment-5529393-20140916022609/@comment-5529393-20140916110337

So you're saying it always returned k+b? That's not what I'm getting...

for b=1 and k=1,2,3,4 I got 2,3,5,7, as I expected. k=5 ran for a really long time without halting, as I also expected.

Testing it for b=3 gave the values I expected as well.