numtheory(deprecated)
fermat
nth Fermat number
Calling Sequence
Parameters
Description
Examples
fermat(n)
fermat(n, w)
n
-
(optional) non-negative integer
w
(optional) unassigned variable
Important: The numtheory package has been deprecated. Use the superseding command NumberTheory[IthFermat] instead.
The nth Fermat number is 22n+1.
fermat(n) returns the nth Fermat number, for n<22.
For any non-negative integer n and unassigned variable w, the function call fermat(n, w) assigns to w the information which is known (at the time of writing this function) about the Fermat number fermat(n). This information consists of: the primality character of fermat(n) (prime, composite, or unknown), and, if it is composite, any known prime factors.
Every factor of a Fermat number fermat(n) has the form 2n+2⁢k+1,2≤k.
If fermat is invoked with no arguments, it returns a list of all Fermat numbers whose primality status is known as of the time when this function was written.
The command with(numtheory,fermat) allows the use of the abbreviated form of this command.
with⁡numtheory:
fermat⁡n
22n+1
fermat⁡0
3
fermat⁡3
257
fermat⁡4,w
65537
it is prime
fermat⁡6,w
18446744073709551617
it is completely factored ,28⁢32⁢7⁢17+1⁢28⁢5⁢47⁢373⁢2998279+1
length⁡fermat⁡20
315653
fermat⁡30,w
object too big
it has these prime factors ,233⁢127589+1,232⁢149041+1
fermat⁡9448,w
it has this prime factor ,19⁢29450+1
fermat⁡10000
character unknown
See Also
NumberTheory[IthFermat]
numtheory(deprecated)[mersenne]
Download Help Document