The following expression
1+(2*3*((4*((5*6)+(7*8)))-9))
evaluates to 2011. Are there more such expressions yielding 2011, keeping the number of operations and the order of the numbers fixed - only varying the arrangement of the brackets and the operations to use in each place.
The program get2011
answers this kind of questions. Since for more than about 10 operations, quite a lot of computations have to be performed, the program allows multithreading.
The program has been generated and developed using the g++
tool chain on a MinGW environment on a Win32 computer. Since MinGW has only rudimentary POSIX support, I have added the pthreads-win32 implementation for being able to work with POSIX threads. Since I was not able to link this library statically, you will need the dynamic library pthreadGC2.dll
to be available when running the program.
There are two posts in my blog http://ruediger-plantiko.blogspot.com, dating October 2011, discussing this program and its parts.