GPT-5-Thinking progressively refines its hypothesis from simple digit heuristics to a full Miller–Rabin test.