Okay, so I know what primes are now, but I'm struggling to figure out how to program prime? and prime in a declarative manner.
I've been looking at the examples for nats and fibs and I'm still a little shaky on how to accomplish what I need.
I guess the thing I am hung up on is to test if a number is prime, then I need to see if it is divisible by any the primes before it. I'm having trouble trying to understand how I would figure out all the primes before the prime I'm testing so that I can get an accurate answer.
For example if I called (prime? 13), then the procedure should try dividing 13 by 11, 7, 5, 3, and 2 and if they don't divide evenly, then the number is prime. How do I calculate for 11, 7, 5, 3, and 2
If I have this all wrong, please let me know.