I thought this would be a hard problem but I found a link that seems to ask the answer to this question as a homework problem? Can somone help me out here, are there an infinite number of prime powers that differ by 1? or are there a finite number of them? If so which are they?
[Math] What prime powers differ by one
elementary-number-theorynumber theoryprime numbers
Related Solutions
There is an infinite number of such pythagorean triples. Any primitive pythagorean triple $(a,b,c)$ with $a^2+b^2=c^2$ (are we are looking for primitive triples since we want $a$ and $b$ consecutive) is of the form: $$ a=p^2-q^2,\qquad b=2pq,\qquad c=p^2+q^2 $$ with $p$ and $q$ coprime and not both odd. So we are looking for integer solutions of: $$ p^2-2pq-q^2 =\pm 1,$$ or: $$ (p-q)^2 - 2q^2 = \pm 1.$$ However we know that the Pell equation $A^2-nB^2=1$ has an infinite number of integer solutions $(A,B)$ for every $n$ that is not a square, hence we can find "consecutive" pythagorean triples from the solutions of $$ A^2 - 2B^2 = 1,\tag{1}$$ for istance. $(A,B)=(3,2)$ is the minimal solution of $(1)$, giving $(p,q)=(5,2)$, hence the triple $(20,21,29)$. The next solution can be found by expanding: $$ (3+2\sqrt{2})^2 = 17+12\sqrt{12},$$ hence $(p,q)=(29,12)$ gives the triple $(696,697,985)$ and so on.
In general, we can see that all the solutions depends on the convergents of the continued fraction of $\sqrt{2}$, i.e. on the Pell sequence: $$ (p,q) = (P_n,P_{n+1}),$$ from which:
$$ (a_n,b_n) = (2P_nP_{n+1},P_{n+1}^2-P_{n}^2) = (2P_n P_{n+1},2P_nP_{n+1}+(-1)^n),$$
where:
$$P_n = \frac{1}{2\sqrt{2}}\left((1+\sqrt{2})^n-(1-\sqrt{2})^n\right).$$
Since neither $2P_n P_{n+1}$ or $P_{n+1}^2-P_{n}^2$ may be primes if $n> 1$, the only "consecutive" pythagorean triple with the smallest element being a prime is $(3,4,5)$.
$\newcommand{\Set}[1]{\left\{ #1 \right\}}$$\newcommand{\N}{\mathbb{N}}$Is there any reason why you would want an explicit bijection?
Because you can prove that your set $$ X = \Set{ x \in \N : \text{$x$ is not a power of a prime}} $$ is in a bijection with the natural numbers without making the bijection explicit.
First note that $$ n \mapsto 2 \cdot (2 n + 3) $$ is an injective map from $\N$ to your set $X$. (I have taken $2 n + 3$ so that it works whether one includes zero in $\N$ ot not.)
Then $x \mapsto x$ is an injective map $X \mapsto \N$.
This guarantees that there is a bijection $\N \to X$.
Best Answer
Catalan's Conjecture, a theorem since $2002$, shows that the only examples where the exponents are $\ge 2$ are $3^2-2^3$.
If we allow exponent equal to $1$, the answer is not known. Perhaps there are infinitely many Fermat primes, that is, primes of the form $2^n+1$ (it turns out that for $2^n+1$ to be prime, we need $n$ to have shape $2^k$).
For many years, only five such primes have been known. There may not be others, or there may be finitely many others, or infinitely many. At the current time, we do not know.