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:
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.