prime and factorial