2006-05-26 google programmer Wei-Hwa's 在發表了他個人的一個Google Gadget "Wei-Hwa's Puzzle Challenges"(前身是Da Vince Code Quest :google 與電影Da Vince Code合作的Gadget)。每週提供一個有趣的小遊戲。第一次的題目就是:

Using the numbers 3, 3, 8, 8 (in any order), make a mathematical expression that equals 24. You can use only addition, subtraction, multiplication, and division (and parentheses), but in any order you wish. Note that you have to use all four numbers; otherwise 3 times 8 would be valid -- and that wouldn't be much of a puzzle, would it?

利用3,3,8,8(任何順序)寫一個數學式計算出結果為24。只能用加減乘除(含括號)等符號。請注意,必須四個數都用到,且不能用8三次。



ANS: [8 / (3 - 8/3) = 24]

如果是 7,7,3,3 或是 5,5,5,1 = 24 又該如何寫這數學式呢?

Reference: Wei-Hwa's Puzzle Challenges

以上連結還可以找到,一些計算的程式喔!!

7 * (3 + 3/7) = 24

5 * (5 - 1/5) = 24