z and c can be integers when p>2. you also have to prove that statement you can't just say it.

Also fermat's theorem as far as I know isn't just for primes, it's for all numbers. Unless this is some other theorem by fermat. In which case you need to state it so we know what your talking about.