Difference between revisions of "2022 IMO Problems/Problem 5"

(Created page with "==Problem== Find all triples <math>(a,b,p)</math> of positive integers with <math>p</math> prime and <cmath>a^p = b! + p</cmath> ==Solution== https://www.youtube.com/watch?v=...")
 
(Solution 2)
(3 intermediate revisions by 3 users not shown)
Line 2: Line 2:
 
Find all triples <math>(a,b,p)</math> of positive integers with <math>p</math> prime and
 
Find all triples <math>(a,b,p)</math> of positive integers with <math>p</math> prime and
 
<cmath>a^p = b! + p</cmath>
 
<cmath>a^p = b! + p</cmath>
 +
 +
==Video solution==
 +
https://www.youtube.com/watch?v=-AII0ldyDww [Video contains solutions to all day 2 problems]
  
 
==Solution==
 
==Solution==
https://www.youtube.com/watch?v=-AII0ldyDww [Video contains solutions to all day 2 problems]
+
 
 +
'''Case 1:''' <math>b < p</math>
 +
 
 +
* Since <math>b!</math> is indivisible by <math>p</math>, then <math>a</math> must also be indivisible by <math>p</math>.
 +
 
 +
* If <math>a \le b</math>, then <math>a^p-b!</math> is divisible by <math>a</math>, so <math>a</math> must be a divisor of <math>p</math>, but <math>a=1</math> obviously has no solutions and we ruled out <math>a=p</math> already. For <math>a > b</math>, let's show that there are no solutions using simple inequalities.
 +
 
 +
* If <math>b < a < p</math>, then <math>b! \le (a-1)! \le (a-1)^{a-1}</math> and <math>a^p = (a-1+1)^p \ge (a-1)^p + p (a-1)^{p-1}</math> by throwing away the remaining (non-negative) terms of binomial theorem. For any solution, <math>(a-1)^p + p (a-1)^{p-1} \le a^p = b!+p \le (a-1)^{a-1} + p</math>, which is impossible for <math>a-1 > 1</math>. That leaves us with <math>a=2</math> and <math>b=1</math>, but <math>2^n > n+1</math> for any integer <math>n \ge 2</math> (proof by induction), so there are no solutions.
 +
 
 +
* If <math>b < p < a</math>, RHS is at most <math>(p-1)^{p-1}+p</math> and LHS is at least <math>(p+1)^p \ge p^p+p</math> (again from binomial theorem), which gives no solutions as well.
 +
 
 +
'''Case 2:''' <math>p \le b < 2p</math>
 +
 
 +
* Since <math>b!</math> is divisible by <math>p</math>, then <math>a</math> must also be divisible by <math>p</math>.
 +
 
 +
* In addition, RHS is at most <math>(2p-1)!+p = p \prod_{i=1}^{p-1} (p-i)(p+i) + p < p^{2p-1} + p \le p^{2p}</math>, so <math>a < p^2</math>. We may write <math>a=pc</math>, where <math>1 \le c < p</math>.
 +
 
 +
* Since <math>c</math> is a divisor of <math>a^p</math> and <math>b!</math> it must also be a divisor of <math>p</math>, so <math>c=1</math> and <math>a=p</math>. We're looking for solutions of <math>p^{p-1}-1 = b!/p</math>.
 +
 
 +
* Let's factorise <math>p^{p-1}-1</math>: if <math>p-1 = 2^k \cdot n</math> with <math>n</math> odd and <math>k > 0</math>, it's
 +
 
 +
<cmath>(p^n-1) \cdot (p^n+1) \cdot (p^{2n}+1) \cdot \ldots \cdot (p^{2^{k-1} n}+1) = (p-1) \cdot (1+p+\ldots+p^{n-1}) \cdot (p+1) \cdot (1-p+\ldots-p^{n-2}+p^{n-1}) \cdot (p^{2n}+1) \cdot \ldots \cdot (p^{2^{k-1} n}+1) \,.</cmath>
 +
 
 +
* Since <math>(1+p+\ldots+p^{n-1})</math> and <math>(1-p+\ldots-p^{n-2}+p^{n-1})</math> contain an odd number of odd terms (remember the assumption <math>k > 0</math> aka <math>p \neq 2</math>), they're odd. Also, <math>p^2 \equiv 1</math> modulo <math>4</math>, so <math>(p^{2n}+1)</math> and each following term is even but indivisible by <math>4</math>. The highest power of <math>2</math> dividing <math>p^{p-1}-1</math> is therefore <math>2^{k + l + k-1}</math> where <math>2^l</math> is the highest power dividing <math>p+1</math>.
 +
 
 +
* In comparison, <math>(p+1)!/p</math> has factors <math>(p+1)</math>, <math>(2^k n)</math> <math>(2^{k-1} n)</math> etc (up to <math>2n</math>), and <math>(p-1)/2-k</math> other even factors, so it's divisible at least by <math>2^{l+k(k+1)/2+(p-1)/2-k}</math>. Since <math>l+k(k+1)/2+(p-1)/2-k > l+2k-1</math> for <math>p \ge 7</math>, the only possible solutions have <math>p < 7</math> or <math>b = p</math>.
 +
 
 +
* If <math>b=p</math>, we reuse the inequalities <math>p^{p-1} \ge (p-1)^{p-1}+p-1</math> and <math>b!/p \le (p-1)^{p-1}</math> to show that there are no solutions for <math>p > 2</math>.
 +
 
 +
* Finally, <math>5^5-5 = 3120</math> isn't a factorial, <math>3^3-3 = 24 = 4!</math> and <math>2^2-2 = 2 = 2!</math>.
 +
 
 +
'''Case 3:''' <math>2p \le b</math>
 +
 
 +
Just like in case 2, <math>b!</math> is divisible by <math>p</math> so <math>a</math> must also be divisible by <math>p</math>. However, <math>b!</math> and <math>a^p</math> are also both divisible by <math>p^2</math>, so remainders modulo <math>p^2</math> tell us that no solutions exist.
 +
 
 +
'''Conclusion:'''
 +
 
 +
The only solutions are <math>(a,b,p) = (2,2,2), (3,4,3)</math>.
 +
 
 +
==Solution 2==
 +
 
 +
 
 +
I considered the cases:
 +
 
 +
1) If \(a\) is even, then it must:
 +
  1.a) \(b \neq 1\) and \(p > 2\)
 +
  1.b) \(b!\) is even and \(p = 2\)
 +
 
 +
2) If \(a\) is odd, then it must:
 +
  2.a) \(b \neq 1\) and \(p = 2\)
 +
  2.b) \(b!\) is even and \(p > 2\)
 +
 
 +
Examining 1.a), we end up with an equation of the form \(a^p = p+1\), which has no integer solutions.
 +
 
 +
In case 1.b), \(b!\) can take values: 2, 6, 24, 120, 720, ..., so \(b!+2\) takes values: 4, 8, 26, 122, 722, .... We observe that the only perfect square is 4 among the possible cases, as for \(b \geq 5\), the result ends in 2, which is not a perfect square. Therefore, we have the triple \((2,2,2)\).
 +
 
 +
Case 2.a) yields \(a^2 = 3\), which is rejected.
 +
 
 +
Examining the last case 2.b), we have for \(b!\) the values: 2, 6, 24, 120, 720, 5040,
 +
  i) \(b! = 2\), then \(a^p = 2+p\), which is rejected.
 +
  ii) \(b! = 6\), then \(a^p = 6+p\), also does not give integer solutions.
 +
  iii) \(b! = 24\), then \(a^p = 24+p\), giving a solution for \(p=3\). Thus, we have the triple \((3,4,3)\).
 +
  iv) \(b \geq 5\):
 +
      \(a^3 = b! + 3\), so \(a\) must end in 3 or 7, which does not give solutions.
 +
      \(a^5 = b! + 5\), so \(a\) must end in 5, also not giving solutions.
 +
      \(a^7 = b! + 7\), so \(a\) must end in 3, again not giving solutions.
 +
      \(a^{11} = b! + 11\), no \(a \in \mathbb{Z^+}\) satisfies this.
 +
      \(a^{19} = b! + 19\), similarly, no solutions.
 +
      Other prime exponents reduce to these, as their last digit is one of \(\{1,3,7,9\}\)
 +
 
 +
The analysis of the last case is incomplete, which is why I wasn't initially sure about the number of triples. Therefore, with this approach (which is not strictly documented), we find the triples: \((2,2,2), (3,4,3)\).
 +
 
 +
==See Also==
 +
 
 +
{{IMO box|year=2022|num-b=4|num-a=6}}

Revision as of 11:50, 20 December 2023

Problem

Find all triples $(a,b,p)$ of positive integers with $p$ prime and \[a^p = b! + p\]

Video solution

https://www.youtube.com/watch?v=-AII0ldyDww [Video contains solutions to all day 2 problems]

Solution

Case 1: $b < p$

  • Since $b!$ is indivisible by $p$, then $a$ must also be indivisible by $p$.
  • If $a \le b$, then $a^p-b!$ is divisible by $a$, so $a$ must be a divisor of $p$, but $a=1$ obviously has no solutions and we ruled out $a=p$ already. For $a > b$, let's show that there are no solutions using simple inequalities.
  • If $b < a < p$, then $b! \le (a-1)! \le (a-1)^{a-1}$ and $a^p = (a-1+1)^p \ge (a-1)^p + p (a-1)^{p-1}$ by throwing away the remaining (non-negative) terms of binomial theorem. For any solution, $(a-1)^p + p (a-1)^{p-1} \le a^p = b!+p \le (a-1)^{a-1} + p$, which is impossible for $a-1 > 1$. That leaves us with $a=2$ and $b=1$, but $2^n > n+1$ for any integer $n \ge 2$ (proof by induction), so there are no solutions.
  • If $b < p < a$, RHS is at most $(p-1)^{p-1}+p$ and LHS is at least $(p+1)^p \ge p^p+p$ (again from binomial theorem), which gives no solutions as well.

Case 2: $p \le b < 2p$

  • Since $b!$ is divisible by $p$, then $a$ must also be divisible by $p$.
  • In addition, RHS is at most $(2p-1)!+p = p \prod_{i=1}^{p-1} (p-i)(p+i) + p < p^{2p-1} + p \le p^{2p}$, so $a < p^2$. We may write $a=pc$, where $1 \le c < p$.
  • Since $c$ is a divisor of $a^p$ and $b!$ it must also be a divisor of $p$, so $c=1$ and $a=p$. We're looking for solutions of $p^{p-1}-1 = b!/p$.
  • Let's factorise $p^{p-1}-1$: if $p-1 = 2^k \cdot n$ with $n$ odd and $k > 0$, it's

\[(p^n-1) \cdot (p^n+1) \cdot (p^{2n}+1) \cdot \ldots \cdot (p^{2^{k-1} n}+1) = (p-1) \cdot (1+p+\ldots+p^{n-1}) \cdot (p+1) \cdot (1-p+\ldots-p^{n-2}+p^{n-1}) \cdot (p^{2n}+1) \cdot \ldots \cdot (p^{2^{k-1} n}+1) \,.\]

  • Since $(1+p+\ldots+p^{n-1})$ and $(1-p+\ldots-p^{n-2}+p^{n-1})$ contain an odd number of odd terms (remember the assumption $k > 0$ aka $p \neq 2$), they're odd. Also, $p^2 \equiv 1$ modulo $4$, so $(p^{2n}+1)$ and each following term is even but indivisible by $4$. The highest power of $2$ dividing $p^{p-1}-1$ is therefore $2^{k + l + k-1}$ where $2^l$ is the highest power dividing $p+1$.
  • In comparison, $(p+1)!/p$ has factors $(p+1)$, $(2^k n)$ $(2^{k-1} n)$ etc (up to $2n$), and $(p-1)/2-k$ other even factors, so it's divisible at least by $2^{l+k(k+1)/2+(p-1)/2-k}$. Since $l+k(k+1)/2+(p-1)/2-k > l+2k-1$ for $p \ge 7$, the only possible solutions have $p < 7$ or $b = p$.
  • If $b=p$, we reuse the inequalities $p^{p-1} \ge (p-1)^{p-1}+p-1$ and $b!/p \le (p-1)^{p-1}$ to show that there are no solutions for $p > 2$.
  • Finally, $5^5-5 = 3120$ isn't a factorial, $3^3-3 = 24 = 4!$ and $2^2-2 = 2 = 2!$.

Case 3: $2p \le b$

Just like in case 2, $b!$ is divisible by $p$ so $a$ must also be divisible by $p$. However, $b!$ and $a^p$ are also both divisible by $p^2$, so remainders modulo $p^2$ tell us that no solutions exist.

Conclusion:

The only solutions are $(a,b,p) = (2,2,2), (3,4,3)$.

Solution 2

I considered the cases:

1) If \(a\) is even, then it must:

  1.a) \(b \neq 1\) and \(p > 2\)
  1.b) \(b!\) is even and \(p = 2\)

2) If \(a\) is odd, then it must:

  2.a) \(b \neq 1\) and \(p = 2\)
  2.b) \(b!\) is even and \(p > 2\)

Examining 1.a), we end up with an equation of the form \(a^p = p+1\), which has no integer solutions.

In case 1.b), \(b!\) can take values: 2, 6, 24, 120, 720, ..., so \(b!+2\) takes values: 4, 8, 26, 122, 722, .... We observe that the only perfect square is 4 among the possible cases, as for \(b \geq 5\), the result ends in 2, which is not a perfect square. Therefore, we have the triple \((2,2,2)\).

Case 2.a) yields \(a^2 = 3\), which is rejected.

Examining the last case 2.b), we have for \(b!\) the values: 2, 6, 24, 120, 720, 5040,

  i) \(b! = 2\), then \(a^p = 2+p\), which is rejected.
  ii) \(b! = 6\), then \(a^p = 6+p\), also does not give integer solutions.
  iii) \(b! = 24\), then \(a^p = 24+p\), giving a solution for \(p=3\). Thus, we have the triple \((3,4,3)\).
  iv) \(b \geq 5\):
     \(a^3 = b! + 3\), so \(a\) must end in 3 or 7, which does not give solutions.
     \(a^5 = b! + 5\), so \(a\) must end in 5, also not giving solutions.
     \(a^7 = b! + 7\), so \(a\) must end in 3, again not giving solutions.
     \(a^{11} = b! + 11\), no \(a \in \mathbb{Z^+}\) satisfies this.
     \(a^{19} = b! + 19\), similarly, no solutions.
     Other prime exponents reduce to these, as their last digit is one of \(\{1,3,7,9\}\)

The analysis of the last case is incomplete, which is why I wasn't initially sure about the number of triples. Therefore, with this approach (which is not strictly documented), we find the triples: \((2,2,2), (3,4,3)\).

See Also

2022 IMO (Problems) • Resources
Preceded by
Problem 4
1 2 3 4 5 6 Followed by
Problem 6
All IMO Problems and Solutions