nth Fermat number - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Group Theory : Numbers : numtheory/fermat

numtheory[fermat] - nth Fermat number

Calling Sequence

fermat(n)

fermat(n, w)

Parameters

n

-

(optional) non-negative integer

w

-

(optional) unassigned variable

Description

• 

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&plus;2k&plus;1&comma;2k.

• 

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

withnumtheory&colon;

fermatn

22n&plus;1

(1)

fermat0

3

(2)

fermat3

257

(3)

fermat4&comma;&apos;w&apos;

65537

(4)

w

it is prime

(5)

fermat6&comma;&apos;w&apos;

18446744073709551617

(6)

w

it is completely factored &comma;2832717&plus;1285473732998279&plus;1

(7)

lengthfermat20

315653

(8)

fermat30&comma;&apos;w&apos;

object too big

(9)

w

it has these prime factors &comma;233127589&plus;1&comma;232149041&plus;1

(10)

fermat9448&comma;&apos;w&apos;

object too big

(11)

w

it has this prime factor &comma;1929450&plus;1

(12)

fermat10000

character unknown

(13)

See Also

numtheory[mersenne]


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam