mirror of
https://github.com/renbaoshuo/202401-programming-assignments.git
synced 2024-11-23 15:48:42 +00:00
33 lines
509 B
C
33 lines
509 B
C
|
#include <stdio.h>
|
||
|
|
||
|
int main() {
|
||
|
int n, num = 2, count = 0;
|
||
|
|
||
|
scanf("%d", &n);
|
||
|
|
||
|
for (int i = 2; i <= n; i++) {
|
||
|
num *= 2;
|
||
|
|
||
|
int is_prime = 1;
|
||
|
|
||
|
for (int j = 2; j * j <= num - 1; j++) {
|
||
|
if ((num - 1) % j == 0) {
|
||
|
is_prime = 0;
|
||
|
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if (is_prime == 1) {
|
||
|
printf("%d\n", num - 1);
|
||
|
|
||
|
count++;
|
||
|
}
|
||
|
}
|
||
|
if (count == 0) {
|
||
|
printf("None\n");
|
||
|
}
|
||
|
|
||
|
return 0;
|
||
|
}
|