This discussion board is a place to discuss our Daily Challenges and the math and science
related to those challenges. Explanations are more than just a solution — they should
explain the steps and thinking strategies that you used to obtain the solution. Comments
should further the discussion of math and science.
When posting on Brilliant:
Use the emojis to react to an explanation, whether you're congratulating a job well done , or just really confused .
Ask specific questions about the challenge or the steps in somebody's explanation. Well-posed questions can add a lot to the discussion, but posting "I don't understand!" doesn't help anyone.
Try to contribute something new to the discussion, whether it is an extension, generalization or other idea related to the challenge.
Stay on topic — we're all here to learn more about math and science, not to hear about your favorite get-rich-quick scheme or current world events.
Markdown
Appears as
*italics* or _italics_
italics
**bold** or __bold__
bold
- bulleted - list
bulleted
list
1. numbered 2. list
numbered
list
Note: you must add a full line of space before and after lists for them to show up correctly
# I indented these lines
# 4 spaces, and now they show
# up as a code block.
print "hello world"
# I indented these lines
# 4 spaces, and now they show
# up as a code block.
print "hello world"
Math
Appears as
Remember to wrap math in \( ... \) or \[ ... \] to ensure proper formatting.
2 \times 3
2×3
2^{34}
234
a_{i-1}
ai−1
\frac{2}{3}
32
\sqrt{2}
2
\sum_{i=1}^3
∑i=13
\sin \theta
sinθ
\boxed{123}
123
Comments
Let a!+b=pk for some integers 1<b≤a and p prime. Since b≤a,b∣a!, and so b∣a!+b=pk. Thus, b=pm for some m<k. If m>1, then p,p2,⋯,pm<a, and so pm+(m−1)+⋯+1∣a!=pk−pm=pm(pk−m−1), and p(m−1)+(m−2)+⋯+1∣pk−m−1. This implies that pk−m≡1(modp). But this only works if pk−m=1, or k=m, a contradiction.
So we now have a!+p=pk. Let’s assume that 2p≤a. Then p,2p≤a, therefore p2∣a!. But then p2∣pk−a!=p, a contradiction. So p≤a<2p. Now working with our equation, we get:
a!+p=pk
(p−1)!(p+1)⋯(a−1)a+1=pk−1
(p−2)!(p+1)⋯(a−1)a=pk−2+pk−3+⋯+p+1.
From here on, let’s assume that (p−1)>4. Then we know that (p−2)!≡0(mod(p−1)). We also have pr≡1(mod(p−1)) for all nonnegative r. Applying these,
0≡1+1+⋯+1+1=k−1(mod(p−1)).
So (k−1)=n(p−1), or k=n(p−1)+1 for some integer n. We have a!+p=pn(p−1)+1. Since a<2p, we can write:
Since p>4, we thus have n(p−1)+1<2(p−1)+1, or n<2. Clearly, n must be nonnegative. If n=0, then k=1, which is a contradiction. So n=1 and a!+p=pp.
Now let p−1=2cx and p+1=2dy, with x and y odd. Note either that c or d, but not both, must equal 1. Furthermore, let P2(e) denote the power of 2 in the prime factorization of some integer e. For example, by our definitions, P2(p−1)=c and P2(p+1)=d. Note that if we can write e out as a product e1⋅e2⋅⋅⋅ei, then we can write P2(e)=P2(e1⋅e2⋯ei)=P2(e1)+P2(e2)+⋯+P2(ei).
Case 1: c=1. We then have:
a!=pp−p=p(pp−1−1)=p(p2x−1)=p(px−1)(px+1)
a!=p(p−1)(px−1+⋯+p2+p+1)(p+1)(px−1−⋯+p2−p+1)
P2(a!)=0+1+0+d+0
P2(a!)=d+1
Case 2: d=1. We then have:
a!=pp−p=p(pp−1−1)=p(p2cx−1)
a!=p(px−1)(px+1)(p2x+1)(p22x+1)⋯(p2c−1x+1)
P2(a!)=0+c+1+1+1+⋯+1
P2(a!)=2c
To generalize, we can say that P2(a!)=c(d+1) to cover both of these cases. We now directly give a bound for P2(a!):
P2(a!)=⌊a/2⌋+⌊a/22⌋+⋯+⌊a/2z⌋,
where z is such that 2z≤a<2z+1. Since a≥2z,
P2(a!)≥2z−1+2z−2+⋯+1=2z−1.
Moving on, we have:
2cx=p−1<a<2z+1
2c−1−1<2c−1x−1<2z−1≤P2(a!)=c(d+1)
2c−1−1<c(d+1).
Also,
2dy=p+1≤a+1<2z+1+1<2z+1+2
2d−1−2<2d−1y−2<2z−1≤P2(a!)=c(d+1)
2d−1−2<c(d+1).
In the case where c=1, we use the second result here, and simplify: 2d−1−3<d. The only d for which this equation holds are d=1,2,3. Once again, we can’t have d=1, so here, d=2 or 3. Likewise, in the case where d=1, using the first result and simplifying, we get 2c−1−1<2c. In this case, omitting the solution of c=1, we must have c=2,3 or 4. Since c≤4 and d≤3, but one of c,d is 1, we have P2(a!)=c(d+1)≤8. But then note that P2(12!)=10, so we must then have a≤11. But then p≤a≤11, and p=7,11 are the only possibilities. But a!=77−7 and a!=1111−11 have no solutions for a.
Our original assumption that (p−1)>4 must then be false, so we consider a!+p=pk for p=2,3,5 and p≤a<2p. If p=2, then a=2 or 3. We see that 2!+2=22 and 3!+2=23. Moving on, if p=3, then a=3,4, or 5. From here, we get 3!+3=32 and 4!+3=33, but a=5 has no solutions. If p=5, then a=5,6,7,8, or 9. From these, we have 5!+5=53 and no other solutions. Thus, the only solutions (a,p,k) are (2,2,2),(3,2,3),(3,3,2),(4,3,3), and (5,5,3).
What a great solution! It captures so many useful ideas.
I likewise solved the problem by looking at powers of 2. However, most of my solution is bounding work, which would have been greatly simplified if I found k=p. Something I have to keep in mind is p−1∣k−1, which I have seen in another problem involving factorials, but forgot to consider here. Also that bound on a! to derive n=1 takes a bit of intuition; it did not come to my mind though.
Easy Math Editor
This discussion board is a place to discuss our Daily Challenges and the math and science related to those challenges. Explanations are more than just a solution — they should explain the steps and thinking strategies that you used to obtain the solution. Comments should further the discussion of math and science.
When posting on Brilliant:
*italics*
or_italics_
**bold**
or__bold__
paragraph 1
paragraph 2
[example link](https://brilliant.org)
> This is a quote
\(
...\)
or\[
...\]
to ensure proper formatting.2 \times 3
2^{34}
a_{i-1}
\frac{2}{3}
\sqrt{2}
\sum_{i=1}^3
\sin \theta
\boxed{123}
Comments
Let a!+b=pk for some integers 1<b≤a and p prime. Since b≤a,b∣a!, and so b∣a!+b=pk. Thus, b=pm for some m<k. If m>1, then p,p2,⋯,pm<a, and so pm+(m−1)+⋯+1∣a!=pk−pm=pm(pk−m−1), and p(m−1)+(m−2)+⋯+1∣pk−m−1. This implies that pk−m≡1(modp). But this only works if pk−m=1, or k=m, a contradiction.
So we now have a!+p=pk. Let’s assume that 2p≤a. Then p,2p≤a, therefore p2∣a!. But then p2∣pk−a!=p, a contradiction. So p≤a<2p. Now working with our equation, we get:
a!+p=pk
(p−1)!(p+1)⋯(a−1)a+1=pk−1
(p−2)!(p+1)⋯(a−1)a=pk−2+pk−3+⋯+p+1.
From here on, let’s assume that (p−1)>4. Then we know that (p−2)!≡0(mod(p−1)). We also have pr≡1(mod(p−1)) for all nonnegative r. Applying these,
0≡1+1+⋯+1+1=k−1(mod(p−1)).
So (k−1)=n(p−1), or k=n(p−1)+1 for some integer n. We have a!+p=pn(p−1)+1. Since a<2p, we can write:
a!≤(2p−1)!=[(p−(p−1))(p+(p−1))]⋯[(p−2)(p+2)][(p−1)(p+1)]p
a!≤[p2−(p−1)2][p2−(p−2)2]⋯[p2−22][p2−12]p
a!<(p2)(p2)⋯(p2)(p2−1)p
a!<(p2)p−2(p2−1)p
a!<p2(p−2)+1(p2−1).
And so:
pn(p−1)+1=a!+p<p2(p−2)+1(p2−1)+p=p2(p−1)+1−p2p−3+p<p2(p−1)+1.
Since p>4, we thus have n(p−1)+1<2(p−1)+1, or n<2. Clearly, n must be nonnegative. If n=0, then k=1, which is a contradiction. So n=1 and a!+p=pp.
Now let p−1=2cx and p+1=2dy, with x and y odd. Note either that c or d, but not both, must equal 1. Furthermore, let P2(e) denote the power of 2 in the prime factorization of some integer e. For example, by our definitions, P2(p−1)=c and P2(p+1)=d. Note that if we can write e out as a product e1⋅e2⋅⋅⋅ei, then we can write P2(e)=P2(e1⋅e2⋯ei)=P2(e1)+P2(e2)+⋯+P2(ei).
Case 1: c=1. We then have:
a!=pp−p=p(pp−1−1)=p(p2x−1)=p(px−1)(px+1)
a!=p(p−1)(px−1+⋯+p2+p+1)(p+1)(px−1−⋯+p2−p+1)
P2(a!)=0+1+0+d+0
P2(a!)=d+1
Case 2: d=1. We then have:
a!=pp−p=p(pp−1−1)=p(p2cx−1)
a!=p(px−1)(px+1)(p2x+1)(p22x+1)⋯(p2c−1x+1)
P2(a!)=0+c+1+1+1+⋯+1
P2(a!)=2c
To generalize, we can say that P2(a!)=c(d+1) to cover both of these cases. We now directly give a bound for P2(a!):
P2(a!)=⌊a/2⌋+⌊a/22⌋+⋯+⌊a/2z⌋,
where z is such that 2z≤a<2z+1. Since a≥2z,
P2(a!)≥2z−1+2z−2+⋯+1=2z−1.
Moving on, we have:
2cx=p−1<a<2z+1
2c−1−1<2c−1x−1<2z−1≤P2(a!)=c(d+1)
2c−1−1<c(d+1).
Also,
2dy=p+1≤a+1<2z+1+1<2z+1+2
2d−1−2<2d−1y−2<2z−1≤P2(a!)=c(d+1)
2d−1−2<c(d+1).
In the case where c=1, we use the second result here, and simplify: 2d−1−3<d. The only d for which this equation holds are d=1,2,3. Once again, we can’t have d=1, so here, d=2 or 3. Likewise, in the case where d=1, using the first result and simplifying, we get 2c−1−1<2c. In this case, omitting the solution of c=1, we must have c=2,3 or 4. Since c≤4 and d≤3, but one of c,d is 1, we have P2(a!)=c(d+1)≤8. But then note that P2(12!)=10, so we must then have a≤11. But then p≤a≤11, and p=7,11 are the only possibilities. But a!=77−7 and a!=1111−11 have no solutions for a.
Our original assumption that (p−1)>4 must then be false, so we consider a!+p=pk for p=2,3,5 and p≤a<2p. If p=2, then a=2 or 3. We see that 2!+2=22 and 3!+2=23. Moving on, if p=3, then a=3,4, or 5. From here, we get 3!+3=32 and 4!+3=33, but a=5 has no solutions. If p=5, then a=5,6,7,8, or 9. From these, we have 5!+5=53 and no other solutions. Thus, the only solutions (a,p,k) are (2,2,2),(3,2,3),(3,3,2),(4,3,3), and (5,5,3).
Log in to reply
What a great solution! It captures so many useful ideas.
I likewise solved the problem by looking at powers of 2. However, most of my solution is bounding work, which would have been greatly simplified if I found k=p. Something I have to keep in mind is p−1∣k−1, which I have seen in another problem involving factorials, but forgot to consider here. Also that bound on a! to derive n=1 takes a bit of intuition; it did not come to my mind though.
Log in to reply
Yeah that's a way I like to sometimes look at odd factorials. In general,
(2k−1)!=[k+1][k−1][k+2][k−2]⋯[k+(k−1)][k−(k−1)]k
=[k2−12][k2−22]⋯[k2−(k−1)2]k
<(k2)k−1k
=k2k−1.
This result is also achievable through AM-GM, but this method allowed for the variation I needed to get the result I was looking for.