A friend and I have written a basic Proth number tester that asks for k and an upper/lower bound of n, then tests with N=k*(2^n)-1 with a nice do-while loop.
That all works fine...unless we input an upper bound greater than 33 or so. I've yet to determine what exactly causes the program to hang, but it appears as though it cannot handle an N larger than 11 digits.
Quite an improvement over the previous version, which could not handle larger than (2^31)-1.
You can see our code here:
http://code.google.com/p/gjsieve/source/browse/main_5.cpp
We believe it's a stack problem. I'm just not sure how to increase it properly. We were told to increase max stack size in linking options for the compiler, but that changed nothing.
If we try with k = 3, lower = 3, and upper = 33, it works fine. If we input 34 as the upper bound, it hangs and uses all available CPU...
What's going on, exactly?