• + 2 comments

    Curiously enough, when this code is executed an integer overflow occurs when temp is multiplied by 53, but the code still produces correct result since 2*3*5*7*11*13*17*19*23*29*31*37*41*43*47*53-2^64 is greater than 10^18. Funny things start to happen when N is greater or equal to 14142414403480493114, but this value is outside of the range of allowed inputs.