-->
当前位置:首页 > 题库

PROGRAMMING:Mason number

Luz5年前 (2021-05-10)题库425
A prime number in the form of $$2 ^ n - 1 $$is called a Mersenne number. For example, $$2 ^ 2 - 1 = 3 $$, $$2 ^ 3 - 1 = 7 $$are Mason numbers. In 1722, Euler, a blind Swiss mathematician, proved that $$2 ^ {31} - 1 = 2147483647 $$is a prime number, which can be called a record of "the largest known prime number" in the world at that time.
This problem requires the preparation of a program, for any positive integer $$n $$($$n < 20 $$), output all the Mason numbers not exceeding $$2 ^ n - 1 $.
###Input format:
The input gives the positive integer $$n $$($$n < 20 $$) in one line.
###Output format:
Output all Mason numbers no more than $$2 ^ n - 1 $$in descending order, one for each line. If not, output "None".
###Input example:
```in
six
```
###Output example:
```out
three
seven
thirty-one
```






answer:If there is no answer, please comment