K freshman season Mersenne primes Sichuan University

Here Insert Picture Description

Topics that simple! !
The first four good looking, 3,7,31,127,
the fifth violent 1.1 a row but will also test several times wa
eh? ? Why do I have a computer do the math? ?
Analog look
feel Mersenne primes if the range is very difficult to look the General Assembly

#include<bits/stdc++.h>
using namespace std;
bool check(int x)
{
	for(int i=2;i*i<=x;i++)
		if(x%i==0)
			return false;
	return true;
}
int main()
{
	printf("3 7 31 127 8191");
//	long long ans=2;
//	for(int i=1;i<20;i++)
//	{
//		ans*=2;
//		if(check(ans-1))
//			printf("%d\n",ans-1);
//	}
	return 0;
}

I have good fishing ah

Published 54 original articles · won praise 4 · Views 890

Guess you like

Origin blog.csdn.net/weixin_45460987/article/details/103394776