Determine all possible quadruplets (p, q, r, s) of positive integers with p< = q< = r satisfying the equation p! + q! + r! = 2^s.
Since p<=q<=r, p! is a factor of both q! and r! so factor the sum
p!(1 + q!/p! + r!/p!) = 2^s
Since every factor of 2^s is a power of 2, p! must be a power of 2, so p can only be 1 or 2.
Case 1: p=1
1 + q! + r! = 2^s
since 2^s is even, either q! or r! is odd and the other is even.
The only odd factorial (allowed) is 1! so this must be q! and r cannot be 1. So we have:
1 + 1 + r! = 2^s
r! = 2^s  2 = 2(2^(s1)1)
since the rhs is the product of 2 and an odd, r! can only have a single 2 in its prime factorization. r can only be 2 or 3. These happen to both work so we have two solutions:
1! + 1! + 2! = 2^2 = 4
1! + 1! + 3! = 2^3 = 8
Case 2: p=2
2 + q! + r! = 2^s
q! + r! = 2^s  2 = 2(2^(s1)  1)
factor out the q!
q!(1+r!/q!) = 2(2^(s1)  1)
again this product has only a single factor of 2, and it must be on the q!, since q is at least 2 so q is either 2 or 3
Subcase 2a: p=2 and q=2
2 + 2 + r! = 2^s
r! = 2^s  4 = 4(2^(s2)  1)
so r must be the product of 4 and an odd number. This is impossible so yields no solutions.
Subcase 2b: p=2 and q=3
2 + 6 + r! = 2^s
r! = 2^s  8 = 8(2^(s3) 1)
so this time r must be the porduct of 8 and an odd number. There are two possibilities, r=4 and r=5. These both work so we have the last two solutions:
2! + 3! + 4! = 2^5 = 32
2! + 3! + 5! = 2^7 = 128

Posted by Jer
on 20070703 12:05:30 