I wish to find the minimum value of Positive integer $n$ for which $2020^n+1$ is a prime number. Since $n$ cannot be odd or of the form $2^jK$, therefore $n$ must be of the form $2^k$. How to proceed further?
-
1Does $n=0$ count? – Levent Sep 13 '20 at 17:52
-
@Levent n must be a natural number – Sagar Sodhani Sep 13 '20 at 17:54
-
How do we even know that there is such an $n$? As you say it is enough to check powers which are powers of $2$, but that doesn't guarantee the existence of an $n$ for which it is prime. This alone doesn't have a proof : all you can do is check these numbers for primality, and be happy when you get your first hit. – Sarvesh Ravichandran Iyer Sep 13 '20 at 17:57
-
"Does n=0 count?" $1$ is not a prime number. – fleablood Sep 13 '20 at 17:58
-
@fleablood: No, but if $n = 0$, then $2020^n+1 = 1+1 = 2$ is a prime number. It's still sort of a cop-out, though. – Brian Tung Sep 13 '20 at 17:59
-
4@SagarSodhani: According to some, $0$ is a natural number; according to others, it is not – J. W. Tanner Sep 13 '20 at 18:02
-
2Oops.... that was embarrassing. – fleablood Sep 13 '20 at 18:04
-
4Okay. I’ve edited the question to say positive integer instead of a natural number to avoid ambiguity. Thanks. – Sagar Sodhani Sep 13 '20 at 18:05
-
@Teresa Lisbon : So there is no other way to either prove or disprove this instead of combing through all the powers of 2? – Sagar Sodhani Sep 13 '20 at 18:06
-
@SagarSodhani Any method to prove it has not been discovered yet, let us put it that way : hence we don't even know if it is true or not that such an $n$ exists. So your best bet is to comb, and since you don't have infinite time, you never know when you're getting the answer. – Sarvesh Ravichandran Iyer Sep 14 '20 at 02:36
-
1@TeresaLisbon I spoke with a friend last night. The Miller Rabin "test of compositeness" is well suited to this. As we suspect that the expression above is always composite, it is reasonable to investigate, instead of patterns among small prime factors, patterns in MR "witness" numbers, which requires nothing more that the powermod algorithm https://en.wikipedia.org/wiki/Miller%E2%80%93Rabin_primality_test#Mathematical_concepts I was not sure, but when MR produces a witness, that is a proof that the number being tested is composite. What if there is a fixed number that serves as a witness? – Will Jagy Sep 14 '20 at 12:36
-
1@WillJagy That is something I did not know about, thank you for informing me! But my programming skills are poor so I hope someone else takes this task on. – Sarvesh Ravichandran Iyer Sep 14 '20 at 13:51
-
1Numbers of this form could easily be proven prime with the $p-1$-method, if they are not too large. But here, we can have bad luck that the smallest prime is out of reach. If upto $n=2^{20}$ no prime occured, hope is already small to find a prime. – Peter Sep 14 '20 at 17:56
-
2The genealized fermat numbers $a^{2^n}+1$ have been tested upto very high bases apparently upto $n=20$. According to the smallest bases $a$ , such that we get a prime (OEIS) , upto $n=20$ , we get no prime for $a=2020$ upto $n=20$. Hence the smallest possibility is $$2020^{2^{21}}+1$$ which has already $$6\ 931\ 825$$ decimal digits. – Peter Sep 15 '20 at 06:47
-
Upto $n=12$ , the compositeness for $a=2020$ has already be shown and for $13\le n\le 20$ , the smallest base $a$ exceeds $10^4$ – Peter Sep 15 '20 at 06:51
1 Answers
This first bit is a tiny part of Miller-Rabin. It is just checking, as in Fermat's LITTLE theorem, whether $2^{n-1} \equiv 1 \pmod n.$ It is not for these first few values of $n =1 + 2020^{\left( 2^k \right)} \; . \; \;$ It appears that I made $k$ equal to "count" minus one.
==============================================
Tue Sep 15 06:07:06 PDT 2020
count 1 n or n % 1000000: 2021
2^(n-1) mod n or that % 1000000: 661
4^(n-1) mod n or that % 1000000: 385
5^(n-1) mod n or that % 1000000: 883
101^(n-1) mod n or that % 1000000: 1046
count 2 n or n % 1000000: 4080401
2^(n-1) mod n or that % 1000000: 392873
4^(n-1) mod n or that % 1000000: 696939
5^(n-1) mod n or that % 1000000: 415506
101^(n-1) mod n or that % 1000000: 201073
count 3 n or n % 1000000: 16649664160001
2^(n-1) mod n or that % 1000000: 7948
4^(n-1) mod n or that % 1000000: 521537
5^(n-1) mod n or that % 1000000: 312595
101^(n-1) mod n or that % 1000000: 917808
count 4 n or n % 1000000: 277211316640788505600000001
2^(n-1) mod n or that % 1000000: 65536
4^(n-1) mod n or that % 1000000: 967296
5^(n-1) mod n or that % 1000000: 890625
101^(n-1) mod n or that % 1000000: 778611
count 5 n or n % 1000000: 76846114073719506240708648109081231360000000000000001
2^(n-1) mod n or that % 1000000: 419286
4^(n-1) mod n or that % 1000000: 63545
5^(n-1) mod n or that % 1000000: 602437
101^(n-1) mod n or that % 1000000: 663872
count 6 n or n % 1000000: 1
2^(n-1) mod n or that % 1000000: 928344
4^(n-1) mod n or that % 1000000: 551554
5^(n-1) mod n or that % 1000000: 527082
101^(n-1) mod n or that % 1000000: 23082
count 7 n or n % 1000000: 1
2^(n-1) mod n or that % 1000000: 808526
4^(n-1) mod n or that % 1000000: 595382
5^(n-1) mod n or that % 1000000: 982181
101^(n-1) mod n or that % 1000000: 749767
count 8 n or n % 1000000: 1
2^(n-1) mod n or that % 1000000: 959018
4^(n-1) mod n or that % 1000000: 26848
5^(n-1) mod n or that % 1000000: 768460
101^(n-1) mod n or that % 1000000: 848154
count 9 n or n % 1000000: 1
2^(n-1) mod n or that % 1000000: 747693
4^(n-1) mod n or that % 1000000: 986246
5^(n-1) mod n or that % 1000000: 31483
101^(n-1) mod n or that % 1000000: 323871
count 10 n or n % 1000000: 1
2^(n-1) mod n or that % 1000000: 210163
4^(n-1) mod n or that % 1000000: 581207
5^(n-1) mod n or that % 1000000: 920926
101^(n-1) mod n or that % 1000000: 393805
count 11 n or n % 1000000: 1
2^(n-1) mod n or that % 1000000: 70595
4^(n-1) mod n or that % 1000000: 593199
5^(n-1) mod n or that % 1000000: 971165
101^(n-1) mod n or that % 1000000: 587666
count 12 n or n % 1000000: 1
2^(n-1) mod n or that % 1000000: 408027
4^(n-1) mod n or that % 1000000: 331817
5^(n-1) mod n or that % 1000000: 817564
101^(n-1) mod n or that % 1000000: 571971
=============================================
It took a while to finish 13
count 13 n or n % 1000000: 1
2^(n-1) mod n or that % 1000000: 447838
4^(n-1) mod n or that % 1000000: 192814
5^(n-1) mod n or that % 1000000: 108756
101^(n-1) mod n or that % 1000000: 270600
==========================================
int mp_PrimeQ( mpz_class i)
{
if ( i <= 0 ) return 0;
else if ( i == 1 ) return 1;
else return mpz_probab_prime_p( i.get_mpz_t() , 50 );
} // mp_PrimeQ
int mp_CompositeQ( mpz_class i)
{
return !(mp_PrimeQ(i));
} // mp_PrimeQ
=======================================================================
Sun Sep 13 11:56:09 PDT 2020
0 2021 = 43 47
PrimeQ 0
1 4080401 = 13 281 1117
PrimeQ 0
2 16649664160001 = 325217 51195553
PrimeQ 0
3 277211316640788505600000001 = 17 cdot mbox{BIG}
PrimeQ 0
4 76846114073719506240708648109081231360000000000000001 = 1153 cdot mbox{BIG}
PrimeQ 0
5 = cdot mbox{BIG}
PrimeQ 0
6 = 257 11777 cdot mbox{BIG}
PrimeQ 0
7 = 638977 cdot mbox{BIG}
PrimeQ 0
8 = 15361 51713 cdot mbox{BIG}
PrimeQ 0
9 = 19457 cdot mbox{BIG}
PrimeQ 0
10 = cdot mbox{BIG}
PrimeQ 0
11 = cdot mbox{BIG}
PrimeQ 0
12 = cdot mbox{BIG}
PrimeQ 0
13 = 65537 163841 cdot mbox{BIG}
PrimeQ 0

- 139,541
-
-
@J.W.Tanner so far none, plus not much pattern in the small prime factors, other than some are themselves Fermat primes. It is stuck on line 14; I do not – Will Jagy Sep 13 '20 at 19:10
-
1If the table here is correct, there should be no primes at least up to line 15. – pregunton Sep 13 '20 at 19:23
-
-
-
1@AnindyaPrithvi $2020^{2^{13}}+1$ has 27078 digits and is not prime, as well as $2020^{2^{14}}+1$. Using Wolfram Mathematica. Quite tiring, tbh... – Raffaele Sep 14 '20 at 06:44
-
@Raffaele if you scroll down within the computer output section of my answer, you can see two small prime factors at line 13. One of them is a Fermat prime, which is suggestive. Perhaps there is a proof that the number being investigated is always composite; a next direction to look at might be writing a Miller-Rabin test ( for me, C++ with GMP) with lots of print statements, see if we can predict a "witness" in this problem. https://en.wikipedia.org/wiki/Miller%E2%80%93Rabin_primality_test#Mathematical_concepts – Will Jagy Sep 14 '20 at 13:11
-
A proof that $2020^{2^n}+1$ is never prime is almost surely out of reach. If we can trust the OEIS-entry with the smallest bases (see above) , there is no prime for $n\le 20$. Candidates are $n=21,22,23$ , in each case no prime factor with less than $16$ digits, but still the numbers have very little chance to be prime. – Peter Sep 15 '20 at 08:26
-
-
@Peter added output at the beginning, this time just $2^{n-1} \pmod n$ where $n = 1 + 2020^{\left( 2^k \right)}$ – Will Jagy Sep 15 '20 at 13:15
-