Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

In addition to the workarounds pointed by @vdelecroix, you can use the following one:

sage: ZZ(p(11)).is_prime()
True

You can also use the is_pseudoprime function, which does not require a previous coercion to the integers ring:

sage: is_pseudoprime(p(11))
True

For $n\geq 2^{64}$, if is_pseudoprime($n$) returns True, it is very likely, but not sure, that $n$ is prime. For $n<2^{64}$, is_pseudoprime($n$) is True if and only if $n$ is prime.