TITLE: Does $9^{2^n} + 1$ always have a prime factor larger than $40$?
QUESTION [11 upvotes]: I'm trying to find out for which natural numbers $n$, does $9^n + 1$ have all of its prime factors less than $40$.  If I can provide a positive answer to my title question, then I will have a proof that only $n = 1$ causes $9^n + 1$ to have all of its prime factors less than $40$.  Thank you for any help.

REPLY [19 votes]: Here is a proof with very few computations involved.
It is well known that
If $\displaystyle x^2 + 1 = 0 (\mod p)$ for some prime $\displaystyle p$, then $\displaystyle p = 1 (\mod 4)$.
Perhaps a little less well known than the above is that
If $\displaystyle x^4 + 1 = 0 (\mod p)$ for some prime $\displaystyle p$, then $\displaystyle p = 1 (\mod 8)$.
Since $\displaystyle 9^{2^n}+1 = (3^{2^{n-1}})^4 + 1$ we must have that the only possible prime  < 40 which is a candidate is $\displaystyle 17$. 
Thus we need to check the residues only for $\displaystyle 17$.
Now since $\displaystyle 3$ is a primitive root of $\displaystyle 17$, we have that $\displaystyle 3^{8} + 1 = 0 (\mod 17)$. Since $\displaystyle 3^{2^3}  = -1 ( \mod 17)$, we have that $\displaystyle 3^{2^n} + 1 = 2 (\mod 17)$ for all $\displaystyle n > 3$.
Thus we only need to check $\displaystyle 3^{2^3} +1 = 9^{2^2} + 1 = 2×17×193$, which has a factor $\displaystyle > 40$ and we are done.

Interestingly, for any number $N$, we can show that at most a finite number of numbers of the form $\displaystyle 9^{2^n}+1$ have all their prime factors  < $\displaystyle N$.
This is because for $\displaystyle m$ < $\displaystyle n$, $\displaystyle 9^{2^m}-1$ divides $\displaystyle 9^{2^n}-1$ which implies that $\displaystyle (9^{2^n} + 1, 9^{2^m} + 1) = 2$.
i.e. any two numbers in the sequence have a gcd of $\displaystyle 2$.
Thus the number of numbers with all prime factors < $\displaystyle N$ is finite.
(Another proof of the same fact is that if $\displaystyle 9^{2^m}+1 = 0 (\mod p)$ then $\displaystyle 9^{2^n}+1 = 2 (\mod p)$ for $n > m$)
In fact, this is a different proof that the number of primes is infinite!