Archive for 2006-05-23

Arithmetic operation of 4 numbers

2006-05-23

During old Orkut days, I had been diving into a challenging yet simple mathematical problem. It all starts from the statement: use 4 4’s to form 44, with arithmetic operators or joining digits together. Of course, the answer is simple:

44+4-4=44
44*4/4=44

There are lots of similar answers. And the fun starts from here: what if the answer is not 44, but any other positive integer? What if the 4 basic digits are not all 4’s, but all possible single digits? For example: use 2,6,7,9 to form 21. So a Japanese and me started the mind boggling marathon, finding answers from 1 to 100. It was a lengthy journey, and when we have finally gone through every integer, I wrote a simple script to check the results (If you want to save it, please rename it to check-rpn.pl). It makes use of Perl Math::RPN module and dc so that I don’t need to handle any parenthesis. Although not well written, it is sufficient for my purpose.

However, the problem is, I didn’t save the result :-)

2006-05-24 Update: avoid usage of latex plugin when I don’t need to.

2006-05-28 Update: The Japanese guy is Katsutoshi Seki. He is quite a nice guy and is popular among very active Orkut users.