Let N be defined by N=> 3*1*4*1*5*9*2, where each asterisk may be replaced by any basic arithmetic sign (
+, - ,* ,/) and
=> means that the result is obtained by calculating sequentially from left to right.
Examples:
3+1+4+1+5+9+2=>25; 3+1-4+1-5+9-2=>3; 3*1-4*1-5+9-2=>1 etc.
How many distinct positive integer results can be obtained?
What is the lowest positive integer that cannot be obtained?
What positive integer claims the highest quantity of distinct expressions?
Rem: No brackets allowed.
A quick program finds 159 distinct positive integer results can be obtained. The lowest positive integer which cannot be obtained as 35. The positive integer with the greatest number of distinct empressions was 2.
There are clearly 4096 options (4**6) with the given integers as constants, and each of six operators having four options. After eliminating zero and negatives and results which were not whole integers, this left 1260 equations to tabulate. Sorting these and counting gave the results above.
I need to double check these lists. My method was to create six imbedded loops for the operators, with four values for each (addition, subtraction, multiplication, division), and then calculate each of the 4096 options left to right with the given digits from pi, and then sort the results, and finally to count. I'll go back to check the coding and counting.