Learn R Programming

modiscloud (version 0.14)

is.pseudoprime2: Check an integer for pseudo-primality to an arbitrary precision, second version

Description

A number is pseudo-prime if it is probably prime, the basis of which is the probabilistic Fermat test; if it passes two such tests, the chances are better than 3 out of 4 that $n$ is prime.

Usage

is.pseudoprime2(n, times)

Arguments

n
the integer to test for pseudoprimality.
times
the number of Fermat tests to perform

Value

Whether the number is pseudoprime

Details

This is an example function for making R packages and R documentation with roxygen2 and roxygenize.

References

Abelson, Hal; Jerry Sussman, and Julie Sussman. Structure and Interpretation of Computer Programs. Cambridge: MIT Press, 1984.

See Also

fermat.test

Examples

Run this code
is.pseudoprime2(13, 4)# TRUE most of the time

Run the code above in your browser using DataLab