https://www.gregmat.com/quizzes/quiz/prepswift-of-numbers-in-factorials-iii (Question 6)
I don’t get the logic implemented here. I tried solving it on my own and used chatgpt/claude for advice but I just couldn’t stick it out. I generalized the formula to this → x+integer (let’s say m) then my answer would prime^m -1 (in this case 7^3-1 =342). However this would only be possible for the cases with (n+1)!. Can someone simplify this approach for me or perhaps give a more intuitive approach.
They essentially tell you that that there are 3 more 7’s in the prime factorization of (n + 1)! than n!. You also know that (n + 1)! = (n + 1) \cdot n!. As such, you must be “gaining” the 3 extra copies of 7 from (n + 1). More mathematically, (n + 1) must be a positive multiple of 7^3. The smallest positive multiple is indeed 7^3.
1 Like
Okay I get the approach here. But what would Should I do for a situation for a situation where I get (n+m)! where m>1 ? That would change the scenario right ?
If you’re interested in generalizing, then it’s often better to start with smaller cases:
\textbf{m = 2:} (n + 2)! = (n + 2)( n + 1) n!. Going off the spirit of our argument from above, the “extra” 3 copies of 7 must come from (n + 2)(n + 1). Since (n + 2) and (n + 1) are consecutive, they cannot both be multiples of 7. Thus, the extra 7’s must reside strictly in either (n + 2) or (n + 1). Because we want the lowest n, (n + 2) must contain all the “extra” 7’s, and so (n + 2) = 7^3 \implies n = 7^3 - 2.
By extension, you can repeat this same argument for all m \leq 7. Once you work them out, you’ll realize that the lowest n for those cases is simply n_{\text{lowest}} = 7^3 - m.
\textbf{m = 8}: The argument shifts because your interval is now wide enough to capture two multiples of 7. You can distribute the 7^3 across multiple terms (e.g., giving one term two copies of 7, and another term one copy). The two cases to test are thus just the ranges ending in 56 (spanning 49 to 56) and ending in 49 (spanning 42 to 49). The latter gives you a lower value of n. Believe it or not, you can repeat this argument for 8 \leq m \leq 14. For a closed-form formula, with little effort, you should be able to work out n_{\text{lowest}} = 49 - m for 8 \leq m \leq 14.
I think if you get the general gist of how this works, then it should be trivial to apply it for
15 \leq m \leq 21 and 22 \leq m \leq 27. Finally, m \geq 28 doesn’t really work because your interval is wide enough to capture a minimum of four 7s.
1 Like