Determine all possible quadruplets (p, q, r, s) of positive integers with p< = q< = r satisfying the equation p! + q! + r! = 2^s.
10 for Tot=1 to 1000000
20 for P=1 to int(Tot/3)
30 for Q=P to int((Tot-P)/2)
40 R=Tot-P-Q
50 Sp2=!(P)+!(Q)+!(R)
60 S=int(log(Sp2)/log(2)+0.5)
70 if 2^S=Sp2 then print P;Q;R;S
80 next
90 next
100 next
was allowed to run until the total of p+q+r got to 512 and found only
p q r s
1 1 2 2
1 1 3 3
2 3 4 5
2 3 5 7
|
Posted by Charlie
on 2007-07-03 10:31:57 |