Can 720! be written as the difference of two positive integer powers of 3?

Does the equation: $$3^x-3^y=720!$$ have any positive integer solution?


As alex.jordan writes, $3^x-3^y$ factors as $3^y(3^{x-y}-1)$, so $y$ must be the number of factors of $3$ in $720!$.

I don't actually need to count the number of $3$s in $720!$, so let's just define the notation $720!_3$ for "$720!$ with all of the powers of $3$ divided out". This must yield the other factor $3^{x-y}-1$, so we need to investigate whether $720!_3$ is one less than a power of $3$. To do this we will compute it modulo $3$.

In general we have that $$ (3k)!_3 \equiv (1\cdot 2)^k \cdot k!_3 \equiv (-1)^k k!_3 \pmod 3 $$ And therefore

$$ \begin{align} 720!_3 \equiv 240!_3 &\equiv 80!_3 \equiv 80\cdot 79 \cdot 78!_3 \equiv - 78!_3 \\ &\equiv -26!_3 \equiv -26\cdot 25 \cdot 24!_3 \equiv 24!_3 \\ &\equiv 8!_3 \equiv 8\cdot 7\cdot 6!_3 \equiv -6!_3 \\ &\equiv -2!_3 \equiv -2 \equiv 1 &\pmod 3 \end{align}$$ which is not one less than a multiple of 3, so certainly not one less than a power of $3$.

So the answer is no.


If $$720!=3^x-3^y=3^y\left(3^{x-y}-1\right)$$ and since the power of $3$ dividing $720!$ is $$\left\lfloor\frac{720}{3}\right\rfloor+\left\lfloor\frac{720}{9}\right\rfloor+\left\lfloor\frac{720}{27}\right\rfloor+\left\lfloor\frac{720}{81}\right\rfloor+\left\lfloor\frac{720}{243}\right\rfloor=240+80+26+8+2=356\text{,}$$ it would have to be that $y=356$.

So it remains to see if $3^x-3^{356}=720!$ has an integer solution in $x$.


Side note: we can get a good approximation to $\log_3(720!)$ using Stirling's formula with one more term than is typically used: $$\log_3(720!)\approx\frac{1}{\ln3}\left(720\ln(720)-720 +\frac{1}{2}\ln(2\pi\cdot720)\right)\approx3660.3\ldots$$ Since the terms in Stirling's formula are alternating after this, we can deduce that this is correct to the tenths place. Values of $\ln(3)$, $\ln(720)$, and $\ln(2\pi)$ are easy to calculate by hand to decent precision if needed.


$720!$ is a lot bigger than $3^{356}$. Since $\log_3(720!)\approx3660.3$, in base $3$, $720!$ has $3661$ digits (trigits?), where as $3^{356}$ just has $357$. So $\log_3(720!+3^{356})$ and $\log_3(720!)$ must be very close together. Since the latter is $\approx3660.3$ though, it's not possible for the former to be an integer.

More formally, $$\log_3(720!)<\log_3(720!+3^{356})=x=\log_3(720!)+\log_3\mathopen{}\left(1+\frac{3^{356}}{720!}\right)\mathclose{}<\log_3(720!)+\frac{1}{\ln(3)}\frac{3^{356}}{720!}$$

$$3660.3\ldots<x<3660.3\ldots$$

and there is no integer $x$ between the values on the two ends.


Factorization alternative:

Suppose $$\begin{align} 720!&=3^x-3^y\\ &=3^y(3^{x-y}-1)\\ &=3^y(3-1)(3^{x-y-1}+3^{x-y-2}+\cdots+1)\text{.} \end{align} $$

Since $720!$ is divisible by $4$, the rightmost factor is even, which means it has an even number of terms, and $$720!=3^y(3-1)(3+1)(3^{x-y-2}+3^{x-y-4}+\cdots+1)$$ The rightmost factor must still be even, given how super-even $720!$ is, so $$720!=3^y(3-1)(3+1)(3^2+1)(3^{x-y-4}+3^{x-y-8}+\cdots+1)$$ And again: $$720!=3^y(3-1)(3+1)(3^2+1)(3^4+1)(3^{x-y-8}+3^{x-y-16}+\cdots+1)$$

We can keep extracting factors of the form $3^{2^k}+1$. Except for $3+1$, none of these factors are divisible by $4$. So we can do this many ($13$) times without exhausting the large power of $2$ that divides $720!$:

$$720!=3^y(3-1)(3+1)(3^2+1)(3^4+1)\cdots(3^{8192}+1)(3^{x-y-16384}+3^{x-y-32768}+\cdots+1)$$

But this is now ridiculous. The left side is clearly smaller than $729^{720}=3^{4320}$. While the right side is larger than $3^{8192}$.


Basically the same, but using base-$3$

Exponents are all base ten. Also, $N_{10}$ is base ten. All other numbers are base three. In what follows, each step where an additional factor is factored out, the factorization is justified because the large power of $2$ dividing $720!$ implies that the rightmost factor (with the overbrace) has an even number of $1$s.

$$\begin{align} (10)^{4320} &=(1000000)^{720}\\ &=729_{10}^{720}\\ &>720_{10}!\\ &=3_{10}^x-3_{10}^y\\ &=(10)^x-(10)^y\\ &=\overbrace{2\cdots2}^{x-y}\overbrace{0\cdots0}^y\\ &=2(10)^y\overbrace{11\cdots11}^{x-y}\\ &=2(10)^y(11)\overbrace{0101\cdots0101}^{x-y}\\ &=2(10)^y(11)(101)\overbrace{00010001\cdots00010001}^{x-y}\\ &=2(10)^y(11)(101)(10001)\overbrace{0000000100000001\cdots0000000100000001}^{x-y}\\ &=\cdots\\ &=2(10)^y(11)(101)(10001)\cdots(\overbrace{10\cdots01}^{8193})\overbrace{0\cdots1\cdots0\cdots1}^{x-y}\\ &>\overbrace{10\cdots01}^{8193}\\ &>\overbrace{10\cdots00}^{8193}\\ &=(10)^{8182} \end{align}$$


Let's write $n=x-y$. If $720!=3^x-3^y=3^y(3^n-1)$, then $3^n-1$ is divisible by the primes $17$, $31$, $43$, and $79$ (among others, of course). As it happens, $3$ is a primitive root for those primes. This means that $n$ is divisible by $16$, $30$, $42$, and $78$, hence by the lcm of these, or

$$16\cdot15\cdot7\cdot39=65{,}520$$

But this is vastly larger than $\log_3(720!)\approx3660$. Thus $720!$ is not the difference of two powers of $3$.