View Single Post
Old Apr 13th, 2005, 10:03 PM   #10
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Posts: 1,819
Rep Power: 5 Sane will become famous soon enough
When you think variables, think constants, and dependents.

You need the constant 2, and the dependent 1 through 22.

So far, you've got x**x. But those are both dependents on the values 1 through 22. You missed the constant.


Help with Prime code: % checks for the remainder of division.

So 3%2 = 1 because when you divide 3 into groups of two, you end up with one group of two, and a remainder of one.

Same to 16%5 = 1 and 18%6 = 0

There is a distinct rule with primes and remainders. :p

Last edited by Sane; Apr 13th, 2005 at 10:05 PM.
Sane is offline   Reply With Quote