112

I search the least n such that

$$38^n+31$$

is prime.

I checked the $n$ upto $3000$ and found none, so the least prime of that form must have more than $4000$ digits. I am content with a probable prime, it need not be a proven prime.

Apurv
  • 3,363
  • 2
  • 26
  • 47
Peter
  • 84,454
  • 34
    If $n$ is odd, then $3 \vert (38^n+31)$. If $n$ is of the form $4k+2$, then $5 \vert (38^n+31)$. The only case to be proved is $38^{4k}+31$ is not a prime. –  Dec 07 '13 at 19:49
  • 2
    @user17762, for $n=4$ the smallest factor is 7, for $n=8$ it is 577. Doesn't seem straightforward. – lhf Dec 07 '13 at 19:51
  • 18
    @lhf Yes, for multiple of $4$, interestingly the prime factors get larger if $n \neq 12k+4$. If $n=12k+4$, then $7$ divides $38^n+31$. Hence, the only $n$'s that needs to be checked are $n=12k$ and $n=12k+8$. –  Dec 07 '13 at 19:53
  • I arrived at n=4000 (about 6300 digits) – Peter Dec 07 '13 at 20:23
  • Peter, do you mean $38^{4000}+31$ is prime, or that you have not found primes that far up? – dfeuer Dec 07 '13 at 20:33
  • Alas, it is no prime. – Peter Dec 07 '13 at 20:35
  • 22
    Are you trying to crack some secret key? What got you interested in these numbers? – Julien Dec 07 '13 at 20:36
  • n=5000, still no primes. – Peter Dec 07 '13 at 21:47
  • 1
    @julien what has searching a prime to do with cracking a key ? – Peter Dec 09 '13 at 09:15
  • 7
    @Peter I can't tell you, this is classified. – Julien Dec 09 '13 at 11:49
  • 8
    Just to clarify : I only search this prime for curiousity. And public keys work with factorizations. (before someone draws wrong conclusions) – Peter Dec 09 '13 at 14:40
  • 1
    Just in case it's worth noting: carrying out @user17762's logic, we get the precise result that $s=38^k+31$ has no prime factors smaller than 47 iff $k=0$ or $8$ mod $12$.

    We can exclude all primes less than 70 quite easily too, by excluding $k=34$ mod $46$ and $k=2$ mod $58$.

    – Eric Astor Feb 24 '14 at 19:29
  • 1
    A slight addition to my last comment: if we only allow $k=0$ or $8$ mod $12$, and exclude $k=34$ mod $46$, $k=2$ mod $58$, and $k=18$ mod $70$, the resulting $s=38^k+31$ has no prime factors less than $103$. – Eric Astor Feb 24 '14 at 19:56
  • 16
    Obviously, since nothing is lesser than $-\infty$, and since $39^{-\infty}+31=0+31=31$ is prime, this is then “the least n such that $39^n+31$ is prime”. :-) – Lucian Feb 25 '14 at 14:26
  • 17
    If my idle-time computer calculation is correct, the expression is not prime for $n<185000$. – Peter Košinár Feb 25 '14 at 23:39
  • 1
    @Lucian: That's gibberish. – TonyK Mar 04 '14 at 19:16
  • 12
    No, @TonyK, that's a joke. :-) – Lucian Mar 04 '14 at 22:08
  • $38\equiv-1\mod3$, and $31\equiv1\mod3$. – Lucian Mar 06 '14 at 22:44
  • This is like a Mersenne prime. Try a multiple of 131701. – SAS2507 Mar 11 '14 at 11:32
  • 4
    No prime for $185,000\leq n\leq 200,000$. – Stella Biderman Mar 16 '14 at 07:30
  • 2
    The following Mathematica code--Simplify[PrimeQ[38^n + 31], n \[Element] Integers && n >= 1]--gives False. – Wei-Cheng Liu Mar 18 '14 at 10:29
  • If for some integer $a$, $a | (38^n + 31)$, then $38^n + 2^5 \equiv 1 \pmod a$. By Euler's Theorem, $38^n + 2^5$ can then be written (modulo $a$) as an integer power $k^{\phi(a)}$ for some $k$ coprime to $a$. Perhaps this might be useful! – Yiyuan Lee Mar 18 '14 at 12:27
  • @WangiPaPa: Wolfram alpha says "unknown" when asked if $38^{12*131701}+31$ is prime while it has no problem handling bigger exponents (which, as far as I have tested are composite), I'm afraid this number is too big to be checked on a normal computer though so I don't really know if this can be helpful – Alessandro Codenotti Mar 18 '14 at 16:41
  • 3
    I have compiled a list of all prime numbers < $100000$ which can sometimes divide $38^n+31$. Basically, the same thing @user17762 did in his comment above for $3$ and $5$, I did for a lot more primes. Here is the data on GitHub. – PhiNotPi Mar 23 '14 at 01:46
  • 3
    @Alessandro I have calculated that $38^{12*131701}+31$ is divisible by $16596077$. – PhiNotPi Mar 23 '14 at 16:36
  • Sure, I'll get right to that. Does anybody have a super computer I can borrow? – Shahar Mar 24 '14 at 20:51
  • 2
    @StellaBiderman My search went up to $220,000$ for now, without finding a prime (usual disclaimer about correctness of the computations applies, of course). – Peter Košinár Mar 31 '14 at 17:18
  • @Peter: Have you thought about cross-posting this on MathOverflow ? – Lucian Apr 01 '14 at 13:13
  • similar question just asked. I'm not learned enough to comment on comparable difficulty of the two. http://math.stackexchange.com/questions/760966/is-324455n-ever-prime – snulty Apr 19 '14 at 21:12
  • We have that $47\mid (38^{4k}+31)$ when $k=20 \mod 46$. –  May 13 '14 at 06:04
  • I generalized and computerized the approach I was taking in the above comments and found out that if $n$ is of the form $36k+8$ then $577\mid 38^n+31$. The next 'most common' prime divisor I found is $93377$ which albeit the $n$ have a closed form they are not nearly as nice and there are two distinct linear sequences for the $n$. –  May 14 '14 at 02:42
  • @PhiNotPi how did you generate that table on github? I came up with a way to generate $k$s that we don't need to test but instead of working with one equivalence class I was working with often a couple mod $p-1$. Going back and checking what I had with yours was the same, but yours is much more compact and with a different modulus. –  May 16 '14 at 04:53
  • @Bryan I used Mathematica. Here is the code. – PhiNotPi May 17 '14 at 01:10
  • Are you familiar with http://www.seventeenorbust.com ? It might give you some idea of how hard these problems are. – Gerry Myerson May 19 '14 at 07:30
  • @PeterKošinár Did you use the PFGW ("PrimeForm with George Woltman's library") software for that? – Jeppe Stig Nielsen Jul 23 '18 at 22:49
  • @JeppeStigNielsen Indeed, I used OpenPFGW (which is based on the original PFGW). – Peter Košinár Jul 25 '18 at 11:17
  • Very late to this, but note that one way of showing non-primality for numbers of this form can be to exhibit them as the values of a linear recurrence relation with constant coefficients and exhibit divisibility properties of the values of the recurrence relation; see e.g. https://math.stackexchange.com/questions/1090319/is-f-n2-28-always-a-composite-number/1090340#1090340 for an example of a similar approach. – Steven Stadnicki Feb 21 '19 at 19:50
  • Compare this question to the same question for $$455^{4k}+324$$ (follow link) In that case, because $324$ is four times a perfect fourth power, the answer is different because an Aurifeuillean factorization arises for every exponent $4k$. – Jeppe Stig Nielsen Apr 27 '19 at 09:16
  • @Peter I think that they are all composites. –  Mar 20 '20 at 16:13

4 Answers4

31

This is not a proof, but does not conveniently fit into a comment.

I'll take into account that $n=4k$ is required, otherwise $38^n+31$ will be divisible by $3$ or $5$ as pointed in the comments.

Now, if we treat the primes as "pseudorandom" in the sense that any large number $n$ has a likelihood $1/\ln(n)$ of being prime (which is the prime number density for large $n$), the expected number of primes for $n=4,8,\ldots,4N$ will increase with $N$ as $$ \sum_{k=1}^N\frac{1}{\ln(38^{4k}+31)} \approx\frac{\ln N+\gamma}{4\ln 38} \text{ where }\gamma=0.57721566\ldots $$ and for the expected number of primes to exceed 1, you'll need $N$ in the order of 1,200,000.

Of course, you could get lucky and find it at much lower $n$, but a priori I don't see any particular reason why it should be...or shouldn't.

Basically, in general for numbers $a^n+b$, the first prime will usually come fairly early, otherwise often very late (or not at all if $a$ and $b$ have a common factor).

Of course, this argument depends on assuming "pseudorandom" behaviour of the primes, and so cannot be turned into a formal proof. However, it might perhaps be possible to say something about the distribution of $n$ values giving the first prime over different pairs $(a,b)$.

  • 7
    Also, a value of $n$ over $11030099$ would represent the largest known prime number. Based on your formula above, this gives an expected number of primes still just slightly over $1$. – PhiNotPi Mar 24 '14 at 00:31
  • 9
    A slight refinement of your heuristic: Notice that $38^{4k} + 31$ cannot be divisible by 2, 3, 5, or 31. If we're given a "random" number $N$ not divisible by these four primes, then its likelihood of being prime increases to $\frac 21 \frac 32 \frac 54 \frac{31}{30} \frac{1}{\ln N} = \frac{31}{8 \ln N}$. This adjustment would suggest that the first such prime should occur around $k = 24$, the second around $k = 1000$, the third around $k = 40000$, the fourth around $k = 1900000$, etc. – Ravi Fernando Oct 14 '15 at 18:35
16

Primality of numbers of the form $a^n+b$ is a very hard problem in general. For instance, existence of primes of the form $4294967296^n+1=(2^{32})^n+1$ is an old open problem in number theory (wiki), although it is also easy to show that this can be a prime only for $n$ of a special form (powers of $2$). Your problem $2085136^n+31=(38^4)^n+31$ does not seem much easier.

In other words, a theory-based answer to your problem is very unlikely in the near future. For a practice-based answer you will probably need to use some distributed computing project for searching for prime numbers like PrimeGrid, which has found most of the known large primes of the form $ab^n+c$.

xivaxy
  • 802
9

This should be a comment for @Einar Rødland, but it's too long so I'm making it an answer.

Your argument gives a heuristic that there should be infinitely many primes of this form, but I'm not sure I believe it and here's why:

You are only taking into account the first two "bad" arithmetic sequences when you restrict to looking at things divisible by 4. In fact we have infinitely many "bad" arithmetic sequences we need to throw out.

If we try the same argument for numbers of the form $2^n + 1$ and we throw out $n \equiv 1 \mod 2$ and $n \equiv 2 \mod 4$ as they will all be divisible by 3 or 5, then running your argument would tell us to expect infinitely many primes of this form. However if we throw out all the "bad" arithmetic sequences (which in this case are much easier to classify) then we only are left with $n = 2^k$, taking this into account your heuristic gives finite expectation.

These two problems don't seem that different to me on the surface, and without a better understanding of the higher order "bad" arithmetic sequences, it's not clear to me what the right heuristic should be.

Nate
  • 11,206
  • 1
    This is one of the reasons it is a heuristic argument. In some cases when this type of arguments are formalised, we talk of the generic case which e.g. could be that it would work for "most" expressions of the form $a^n+b$. (In algebraic geometry, "generic" means that the cases are parametrised by some space and the counter-examples are a subspace of lower dimension.) The case $a^n+1$ fails because $a^q+1|a^{qr}+1$ for any odd $r$, and so requires $n=2^k$ for $a^n+1$ to be prime. – Einar Rødland Apr 23 '14 at 18:58
-3

In general, is there any prime of the form $\frac{ab^n+c}{\gcd(a+c,b-1)}$ with integer $n\ge1$, for fixed integers $a\ge1$, $b\ge2$, $c\ne0$, $\gcd(a,c)=1$, $\gcd(b,c)=1$? It is unknown whether this problem is solvable, e.g. let $a=4$, $b=72$, $c=-1$, the smallest prime of the form $\frac{4\cdot72^n-1}{\gcd(4+1,72-1)}$ with $n\ge1$ is at $n=1119849$

If we want to solve this problem, we must for every such $(a,b,c)$ integer triple, either find a prime of this form or prove that there is no prime of this form, e.g.:

$(a,b,c) = (78557,2,1)$, in which all numbers are divisible by at least one of $3, 5, 7, 13, 19, 37, 73$

$(a,b,c) = (11047,3,1)$, in which all numbers are divisible by at least one of $2, 5, 7, 13, 73$

$(a,b,c) = (47,8,1)$, in which all numbers are divisible by at least one of $3, 5, 13$

$(a,b,c) = (334,10,-1)$, in which all numbers are divisible by at least one of $3, 7, 13, 37$

$(a,b,c) = (9,4,-1)$, in which all numbers factored as difference of squares

$(a,b,c) = (1,8,1)$, in which all numbers factored as sum of cubes

$(a,b,c) = (25,12,-1)$, in which even $n$ factored as difference of squares and odd $n$ is divisible by $13$

$(a,b,c) = (64,936,-1)$, in which even $n$ factored as difference of squares and $n$ divisible by $3$ factored as difference of cubes and other $n$ divisible by either $37$ or $109$, etc.