Determine all possible pair(s) (x, y) of nonnegative integers such that (x!*y! - x! - y!) is a perfect square.
(In reply to
possible pairs by Dej Mar)
For totals of x + y through 1003, the only sets are (2,2), (2,3) and (3,2):
list
10 for T=0 to 999999
20 for X=0 to int(T/2)
30 Y=T-X
40 Fx=!(X):Fy=!(Y)
50 Tst=Fx*Fy-Fx-Fy
55 if Tst>=0 then
60 :Sr=int(sqrt(Tst)+0.5)
70 :if Sr*Sr=Tst then print X;Y,Tst,Sr
80 next
90 next
OK
run
2 2 0 0
2 3 4 2
Overflow in 60
?t
1004
OK
(The program looks only for y>x, but the puzzle doesn't so require; therefore the solution includes a reversal of a found pair.)
|
Posted by Charlie
on 2011-03-28 14:29:09 |