Help!

My dumb-fermat-test is being dumb. :( It only counts 2 as a prime.
expt raises a number to a power, e.g. (expt 2 3) returns 8

I think you have misunderstood the meaning of the term 'congruent' here. modulo gives you the remainder when a is divided by n, hence (modulo 2 3) would be 2 (modulo 8 3) would also be 2. This test will therefore always fail if a^n is larger than n. Reading this might prove useful http://en.wikipedia.org/wiki/Modular_arithmetic