$a^b+2$ or $a^b-2$ is in set

Let $A$ be an infinite set of positive integers. For any two $a,b\in A$, $a\neq b$, at least one of the numbers $a^b+2$ and $a^b-2$ are also in $A$. Must $A$ contain a composite number?

• what is a composite number?
– Paul
Nov 27, 2014 at 7:36
• a composite number is an integer larger than one, which is not prime. Nov 27, 2014 at 7:43
• Note that if $A$ does not contain a composite number then all $a$ must be odd. Nov 27, 2014 at 8:58
• @Arian,if I understood the problem correctly,all b must also be odd(since a and b play a symmetric role). Nov 28, 2014 at 4:05
• It is interesting to note that this is false in the finite case, let $A=\{1,3\}$ Nov 29, 2014 at 22:03

Take four odd numbers $a<b<c<d$ from the set, all greater than $3$, such that $c=b^a\pm2$ and $d=c^b\pm2$.
Case 1: $c=b^a\pm2$ and $d=c^b\pm2$ (with equal signs).
Then $c=b^a\pm2\equiv b\pm2 \pmod3$ and $d=c^b\pm2\equiv c\pm2 \pmod3$. One of $b,c,d$ is divisible by $3$.
Case 2: $c=b^a\pm2$ and $d=c^b\mp2$ (with opposite signs). If $b$ is a prime then, by Fermat's theorem, $$d = c^b \mp2 \equiv c\mp2 = b^a \equiv 0 \pmod{b}$$ so $d$ is divisible by $b$. (Obviously $d$ is greater than $b$.)