Find all pairs of positive integers $(n, k)$ satisfying the equation $$n!+n=n^k.$$
Problem
Source: 2023 Austrian Federal Competition For Advanced Students, Part 1 p4
Tags: number theory
04.05.2023 20:03
what exactly are we solving for? A function $f(n)=k$ that gives a satisfactory $k$ for every $n$? A specific $n$ and $k?$
04.05.2023 20:04
Find all pairs of positive integers $(n, k)$ satisfying the equation.
04.05.2023 20:32
This problem has certainly appeared before. Firstly, we may assume $n,k \geq 1$. If $k=1$ then $n!=0$, a contradiction. Now, if $k \geq 2$, put $k=m+1$, and so we have $(n-1)!+1=n^m$. Thus, $(n-1)! \equiv -1 \pmod n$, which happens only when $n$ is a prime. If $n \in \{2,3,5 \}$ we can easily see that the only solutions are $(n,k)=(2,2)$, $(n,k)=(3,2)$ and $(n,k)=(5,3)$. From now on assume that $n \geq 7$. Moreover, $(n-2)!=n^{m-1}+\ldots+n+1,$ and so taking $\pmod {n-1}$ we obtain that $m \equiv n^{m-1}+\ldots+n+1 \equiv (n-2)! \pmod {n-1}$. However, $(n-2)! \equiv 0 \pmod {n-1}$ since it is well known that $x \mid (x-1)!$ if $x$ is composite and $x>4$. Here, $n-1 \geq 6$ and $n-1$ is composite since if it was a prime then $n-1$ and $n$ would both be primes, a contradiction. Therefore, we conclude that $m \equiv 0 \pmod {n-1}$, i.e. $m \geq n-1$. However, this is a contradiction, as $n^{n-2} >(n-2)^{n-2}>(n-2)!=n^{m-1}+\ldots+n+1>n^{m-2} \geq n^{n-2}$. To sum up, the only solutions are $(n,k)=(2,2)$, $(n,k)=(3,2)$ and $(n,k)=(5,3)$
08.05.2023 19:23
Notice that: $(n-1)!=n^{k-1}-1\Longrightarrow (n-1)! \equiv -1 \pmod n$ however this is only possible when $n \in \mathbb{P}$ Furthermore notice that for for $n\le7$ the only solutions are: $(n,k)=(2,2), (3,2), (5,3)$ Claim: There are no solution for $n\ge11$ Proof: $(n-1)!=(n-1)\left(\sum_{i=1}^{k}n^{k-i}\right)$ After expansion we are left with $(n-2)!=\sum_{i=2}^{k}n^{k-i}$ Since $n-1|(n-2)!$ (from the fact that $n-1$ is composite) $\Longrightarrow k-1\equiv \sum_{i=2}^{k}n^{k-i} \equiv 0 \pmod {n-1} \Longrightarrow k-1\equiv 0 \pmod {n-1}\Leftrightarrow k\ge n$ However this is a contradiction since when we plug into our original equation we get: $(n-1)!-n^{n-1}+1\ge0$ which is false since $ (n-1)!\le(n-1)^{n-1}< n^{n-1}$ $\blacksquare$. So the only solutions are $\boxed{(n,k)=(2,2), (3,2), (5,3)}$ And we are done!
19.08.2024 11:58
Notice that clearly $k \neq 1$, and dividing by $n$ gives $(n - 1)! + 1 = n^{k - 1} \implies (n - 1)! \equiv -1 mod{n}$, which means $n$ is prime by converse of Wilson's. Let $n = p$ now, where $p$ is prime. If $p = 2$, then $(2, 2)$ is the solution, so assume $p \neq 2$. Observe that $k < p$, else we have $p^k \geq p^p > p! + p$. So, now consider our equation $(p - 1)! = p^{k - 1} - 1$. Let $q$ be a prime such that $q \mid p - 1$. By LTE, we have $v_q(p^{k - 1} - 1) = v_q(p - 1) + v_q(k - 1) = v_q((p - 1)!)$. Notice that if $q \nmid k - 1$ for any $q$, then $v_q(p - 1) = v_q((p - 1)!)$, which means $p - 1$ is prime, so $p = 3$, yielding the solution $(3, 2)$. So, we have $q \mid k - 1$ for all $q \mid p - 1$. Note that $k - 1 < p - 1$, so if $k - 1$ is composite, then $v_q((p - 1)!) > v_q(p - 1) + v_q(k - 1)$, since $k - 1$ is included in $(p - 1)!$, and $q$ itself is also a part of $(p - 1)!$. Therefore, $k - 1$ must be prime, and $k - 1 = q$, so $p - 1$ must be of the form $q^{\alpha} = (k - 1)^{\alpha}$. If $\alpha \geq 3$, then we have $v_q((p - 1)!) > v_q(k - 1) + v_q(p - 1) = 1 + v_q(p - 1)$. So, $\alpha = 2$, and $p - 1 = q^2$. If $q \neq 2$, then $q^2 > 2q$, so $(p - 1)!$ "includes" $2q$ and $v_q((p - 1)!) \geq v_q(q) + v_q(2q) + v_q(q^2) = 4 > v_q(k - 1) + v_q(p - 1)$. Therefore, $q = 2$, and $p = 5$. Notice that this gives $(5, 3)$ as a solution. Hence, our solutions are $(n, k) = (2, 2), (3, 2), (5, 3)$.