Checking primality for $2 \uparrow \uparrow n + 3 \uparrow \uparrow n$

119 Views Asked by At

Is there a clever way to test primality for

$$2 \uparrow \uparrow n \quad + \quad 3 \uparrow \uparrow n$$

where $n \gt 3$? (Not surprisingly, I got stuck after that)

For $n \le 3$ we get:

$$ \begin{matrix} 2 \uparrow \uparrow 0 \quad + \quad 3 \uparrow \uparrow 0 & = & 1 + 1 & = & 2 & (\text{prime}) & (\text{...}) \\ 2 \uparrow \uparrow 1 \quad + \quad 3 \uparrow \uparrow 1 & = & 2 + 3 & = & 5 & (\text{prime}) & (\text{yes}) \\ 2 \uparrow \uparrow 2 \quad + \quad 3 \uparrow \uparrow 2 & = & 2^2 + 3^3 & = & 31 & (\text{prime}) & (\text{okay}) \\ 2 \uparrow \uparrow 3 \quad + \quad 3 \uparrow \uparrow 3 & = & 2^{2^2} + 3^{3^3} & = & 7625597485003 & (\text{prime}) & (\text{hmm...}) \\ \end{matrix} $$

Example:

One simple way to rule out primality is to check if the last digit of the sum is $5$. Now we know that the last digit of $2^k$ and $3^k$ follow a pattern such that for $2^k$ with $k \equiv 0 \pmod{4}$ the last digit is $6$ and for $3^k$ with $k \equiv 3 \pmod{4}$ the last digit is $7$. From this we can state that for $n \gt 2$ the last digit of $2 \uparrow \uparrow n$ will be $6$ and for $n \gt 1$ the last digit of $3 \uparrow \uparrow n$ will be $7$, which means we can't rule out primality this way.

2

There are 2 best solutions below

3
On BEST ANSWER

For $n$ large enough ($n \ge 6$) ,$ 2\uparrow \uparrow n \equiv 2197 \pmod {4423}$ and $3 \uparrow \uparrow n \equiv 2226 \pmod {4423}$, and so $2 \uparrow \uparrow n + 3\uparrow \uparrow n$ is always a multiple of $4423$.

Assuming the limit of $a \uparrow \uparrow n$ modulo $p$ is "random" in $\Bbb F_p^*$, you can expect to get $2\uparrow \uparrow n +3\uparrow \uparrow n \to 0 \pmod p$ with probability about $1/p$.

The sum over all primes of $1/p$ diverges, so we can expect that there are infinitely many such primes. $4423$ is the smallest such prime.

So you are left with the cases $n=4$ and $n=5$ to inverstigate.

0
On

$$34,276,387$$ is a prime factor of $2\uparrow\uparrow 5+3\uparrow\uparrow 5$ ,found by Sheldon L (See the link above).

I do not know a prime factor of $2\uparrow\uparrow 4+3\uparrow\uparrow 4$, but the number is very probably composite, and if it is prime, even a probable-prime test will be out of reach.