add fermat test for prime