Prime detection code