Solve for n (a positive integer) in each equation:
(1) n! = 8n^4 + 15n^3 - 4n^2 + 15n + 8
(2) n! = 9n^4 + 4n^3 + n^2 + 1344
Both analytic and computer solutions welcome.
The idea in the official solution can be expanded to provide a much better way to reduce the search space of possible answers.
Lets start with the arbitrary equation n! = f(n) and let r be some nonnegative integer satisfying 0 <= r < n.
Divide both sides of the equation by n-r.
Then n*(n-1)*(n-2)*...*(n-r+1)*(n-r-1)! = g(n)*(n-r) + f(r)/(n-r), where g(n) is the quotient of polynomial division.
Since we are working over integers we must have f(r) is divisible by n-r.
(Assuming that n=r is not a solution since that is division by zero).
If r=0 we get the idea presented in the official solution, the constant term must be divisible by n. But if we go just one step further then f(1) must also be divisible by n-1.
So lets apply this to the specific equations given.
Part 1: f(n) = 8n^4 + 15n^3 - 4n^2 + 15n + 8
Quick check shows that n=0 and n=1 are not solutions.
Then we must have 8 is divisible by n, and 42 is divisible by n-1.
Then the possible n are the intersection of {1,2,4,8} and {2,3,4,7,8,15,22,43}
The second condition is not much help here so we still need to test 2, 4, and 8. By direct evaluation we see that n=8 is the only solution.
Part 2: f(n) = 9n^4 + 4n^3 + n^2 + 1344
Quick check shows that n=0 and n=1 are not solutions.
Then we must have 1344 is divisible by n, and 1358 is divisible by n-1.
1344=2^6*3*7 has 7*2*2=28 factors, that's a lot of cases but this is where the second condition helps.
1358 = 2*7*97, so n must be among the set {2,3,8,15,98,195,680,1359}. Out of these the only ones that are factors of 1344 are the subset {2,3,8}
Evaluating these three cases leaves n=8 as the only solution.