numtheory(deprecated)/fermat - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : numtheory(deprecated)/fermat

numtheory(deprecated)

  

fermat

  

nth Fermat number

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

fermat(n)

fermat(n, w)

Parameters

n

-

(optional) non-negative integer

w

-

(optional) unassigned variable

Description

• 

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.

Examples

Important: The numtheory package has been deprecated. Use the superseding command NumberTheory[IthFermat] instead.

> 

with⁡numtheory&colon;

> 

fermat⁡n

22n+1

(1)
> 

fermat⁡0

3

(2)
> 

fermat⁡3

257

(3)
> 

fermat⁡4&comma;w

65537

(4)
> 

w

it is prime

(5)
> 

fermat⁡6&comma;w

18446744073709551617

(6)
> 

w

it is completely factored ,28⁢32⁢7⁢17+1⁢28⁢5⁢47⁢373⁢2998279+1

(7)
> 

length⁡fermat⁡20

315653

(8)
> 

fermat⁡30&comma;w

object too big

(9)
> 

w

it has these prime factors ,233⁢127589+1,232⁢149041+1

(10)
> 

fermat⁡9448&comma;w

object too big

(11)
> 

w

it has this prime factor ,19⁢29450+1

(12)
> 

fermat⁡10000

character unknown

(13)

See Also

NumberTheory[IthFermat]

numtheory(deprecated)[mersenne]