Check Twisted Prime Number in Python

Prompt

Result