Skip to content

Prints out the Fermat numbers and should tell if they are prime or not.

Notifications You must be signed in to change notification settings

CadaeicCadenza/fermatnumbers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Fermat numbers (OEIS A000215)

A regular prime-sided polygon cannot be constructed with only a straightedge and compass, except for the Fermat numbers.

A fermat-number-sided polygon is prime-sided and constructible at the same time, Fermat numbers have the following form:

F(n)=2^2^n+1

The program should print out the fermat numbers.

Here are the first 9 Fermat numbers:

n F(n)
0 3
1 5
2 17
3 257
4 65,537
5 4,294,967,297
6 18,446,744,073,709,551,617
7 340,282,366,920,938,463,463,374,607,431,768,211,457
8 115,792,089,237,316,195,423,570,985,008,687,907,853,269,984,665,640,564,039,457,584,007,913,129,639,937

But if n ≥ 5, the number is not prime anymore.

About

Prints out the Fermat numbers and should tell if they are prime or not.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages