## Factorial And Square

#### Problem

Given that a, b, and c are positive integers, solve the following equation.

a!b! = a! + b! + c2

#### Solution

Without loss of generality let us assume that b a.

If b = a, then, (a!)2 = 2(a!) + c2.

(a!)2 2(a!) + 1 = c2 + 1
(a! 1)2 = c2 + 1

However, as there exists no square which is one more than another square we deduce that b a.

In addition, b 1, otherwise, a! = a! + 1 + c2 c2 = -1.

Dividing a!b! = a! + b! + c2 by b! we get, a! = a!/b! + 1 + c2/b!.

Clearly LHS is integer, and as a!/b! is integer, c2/b! must also be integer. Furthermore, RHS 3, which means that a! 3 a 3.

From a!b! = a! + b! + c2, we get a!b! a! b! + 1 = c2 + 1.

(a! 1)(b! 1) = c2 + 1.

Let us assume that a prime, p 3 mod 4 divides the RHS.

If c2 + 1 0 mod p, it follows that c2 -1 mod p, and it is clear that p does not divide c.

(c2)(p1)/2 = cp1 (-1)(p1)/2 mod p.

But we are given that p 3 mod 4, so p1 2 mod 4, which means that (p1)/2 will be odd, and (-1)(p1)/2 = -1.

Hence cp1 -1 mod p, which is a contradiction, because HCF(c, p) = 1 and by Fermat's Little Theorem, cp1 1 mod p.

In other words, there exists no prime, p 3 mod 4, which divides c2 + 1.

However, for a 4, a! 0 mod 4, and a! 1 3 mod 4; that is, LHS is divisible by a prime, p 3 mod 4.

Hence 1 b a 3, but we have already established that a 3, so we deduce that a = 3 and b = 2.

From a!b! = a! + b! + c2, we get, 12 = 6 + 2 + c2 c = 2.

That is, the original equation has a unique solution: a = 3, b = c = 2.

Related problems:

Factorial Symmetry: a!b! = a! + b!

Factorial And Power Of 2: a!b! = a! + b! + 2c

Factorial Equation: a!b! = a! + b! + c!

Problem ID: 220 (30 Mar 2005)     Difficulty: 4 Star

Only Show Problem