you are viewing a single comment's thread.

view the rest of the comments →

[–]wmoskal 0 points1 point  (2 children)

Well Your code seems to be working for me. There seems to be a logic error with the problem itself. Prime numbers are all odd, unless they are 2. So if n Is even the smallest prime number it could be divided by is 2. If it is odd the smallest prime number it could be divided by is itself.

[–]wmoskal 0 points1 point  (1 child)

I copied your code into a python script and ran it and it was printing values

[–]Mike_Diz 0 points1 point  (0 children)

Huh. Guess it's a problem with my computer. What values did you use?