20220721, 10:38  #1 
"51*462^4631"
Jul 2022
Fujian Prov, China
2^{3} Posts 
Primes n^n+2(n∈2k+1, k∈Z)
I tried to found primes which can be expressed as n^n+2(n∈2k+1, k∈Z), and I ran a python code
Code:
import math k=3 def findgreatestsqrt(num): low=1 high=num while low<high: mid=(low+high)//2 if mid*mid==num: low=mid break elif mid*mid<num: low=mid+1 else: high=mid1 return low def isprime(num,extrainfo=False): fac=1 if num<2: return False if num==2 or num==3: return True for i in range(2,findgreatestsqrt(num)+1): if num%i==0: fac=i if extrainfo: print(str(num)+" can be divided by "+str(i)) break if fac==1: return True else: return False while True: resu=isprime(k**k+2,True) if resu==True: print(str(k)+"^"+str(k)+"+2 is a prime") else: print(str(k)+"^"+str(k)+"+2 is not a prime") k+=2 Code:
3^3+2 is a prime 3127 can be divided by 53 5^5+2 is not a prime 823545 can be divided by 3 7^7+2 is not a prime 387420491 can be divided by 59 9^9+2 is not a prime 285311670613 can be divided by 97 11^11+2 is not a prime 302875106592255 can be divided by 3 13^13+2 is not a prime 437893890380859377 can be divided by 23 15^15+2 is not a prime 827240261886336764179 can be divided by 7 17^17+2 is not a prime 1978419655660313589123981 can be divided by 3 19^19+2 is not a prime 5842587018385982521381124423 can be divided by 31 21^21+2 is not a prime 20880467999847912034355032910569 can be divided by 19 23^23+2 is not a prime 88817841970012523233890533447265627 can be divided by 3 25^25+2 is not a prime 443426488243037769948249630619149892805 can be divided by 5 27^27+2 is not a prime 2567686153161211134561828214731016126483471 can be divided by 51131 29^29+2 is not a prime 17069174130723235958610643029059314756044734433 can be divided by 3 31^31+2 is not a prime 129110040087761027839616029934664535539337183380515 can be divided by 5 33^33+2 is not a prime 1102507499354148695951786433413508348166942596435546877 can be divided by 2003 35^35+2 is not a prime 10555134955777783414078330085995832946127396083370199442519 can be divided by 3 37^37+2 is not a prime 112595147462071192539789448988889059930192105219196517009951961 can be divided by 229 39^39+2 is not a prime 1330877630632711998713399240963346255985889330161650994325137953643 can be divided by 139 41^41+2 is not a prime 17343773367030267519903781288812032158308062539012091953077767198995509 can be divided by 3 43^43+2 is not a prime Numberempire told me that Number 248063644451341145494649182395412689744530581492654164321720600128173828127 (45^45+2) is not a prime Then, I have tried more number(used another website, Wolframalpha( https://www.wolframalpha.com/input?i...+k%3D22+to+300 ), what I expected, I was told that there is not any prime among n^n+2(n∈2k+1, k∈Z, k∈(22,300)) I don't know that whether is 2nd prime among n^n+2(n∈2k+1, k∈Z) exists or not Last fiddled with by Paimon2005 on 20220721 at 10:57 
20220721, 11:46  #3  
"99(4^34019)99 palind"
Nov 2016
(P^81993)SZ base 36
3·1,217 Posts 
Quote:
http://factordb.com/index.php?query=...e=200&format=1 Also, n should not be == 1 mod 3, as the number will be divisible by 3 There should be infinitely many primes of the form n^n+2, as there are no covering congruence, algebraic factorization, or combine of them for n^n+2, the dual of it is 2*n^n+1, there should be also infinitely many primes of this form, however, n^(n+2)+1 seems to be composite for all n > 30 

20220721, 12:13  #4  
"51*462^4631"
Jul 2022
Fujian Prov, China
2^{3} Posts 
Quote:
Code:
ABC2 (2*$a+1)^(2*$a+1)+2 a: from 1 to 100000 (2*368+1)^(2*368+1)+2 (2*674+1)^(2*674+1)+2 

20220721, 12:22  #5  
"99(4^34019)99 palind"
Nov 2016
(P^81993)SZ base 36
3×1,217 Posts 
Quote:
You can try to find the smallest k >= 1 such that (2*n+1)^k+2 is prime, for n not divisible by 3 Last fiddled with by sweety439 on 20220721 at 12:24 

20220721, 15:54  #6 
Mar 2006
Germany
2·3·7·71 Posts 

20220721, 15:59  #7 
Mar 2006
Germany
2·3·7·71 Posts 

20220810, 19:49  #8 
"Jeppe"
Jan 2016
Denmark
10111000_{2} Posts 
For these, the exponent must be a power of two, so you would check:
62^64+1; 126^128+1; 254^256+1; 510^512+1; ... The first many of them are already proven composite by Generalized Fermat prime searches. It seems extremely likely you are correct there are no (more) primes. Similar things happen with n^n+1 and n^(n2)+1. /JeppeSN 
Thread Tools  
Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Mersenne Primes p which are in a set of twin primes is finite?  carpetpool  Miscellaneous Math  4  20220714 02:29 
Irregular primes and other types of primes  sweety439  sweety439  2  20200915 08:35 
Patterns in primes that are primitive roots / Gaps in fullreptend primes  mart_r  Prime Gap Searches  14  20200630 12:42 
Distribution of Mersenne primes before and after couples of primes found  emily  Math  34  20170716 18:44 
possible primes (real primes & poss.prime products)  troels munkner  Miscellaneous Math  4  20060602 08:35 