# Using the digits $7,7,7,7,1$ and the operators $+,-,*,/$ to make a formula which equals $100$

I know the answer is $(7+7)*(7+(1/7))$ or a more ghetto answer is $177-77$.

I'm not interested in the answer, more in the problem itself.

1. What is the name of this class of problem?
2. Is there a repeatable process I can apply to solve it? Or is it one that requires some sort of intuition? ie. Given a different set of digits and operators, could I follow the same process to derive the answer?

I'm a software engineer so my first reaction was to try all combinations of the digits and operators and evaluate each to see if it was $100$. Obviously there are a lot of combinations!

-
I'm assuming you can only use the digits once? And you can concatenate the digits to form number? – Jacob Mar 18 '13 at 17:30
Hi Jacob, yep only once – Fidel Mar 18 '13 at 17:31
(+1) "more ghetto" – Ben Mar 18 '13 at 17:47
It would be interesting to know of a way to compute all such formulas, too. Other than brute-force enumeration, that is... – A.P. Mar 18 '13 at 18:14

## 3 Answers

As it turns out GUILE Scheme does provide hash tables. In order to leave this discussion in an acceptable state for future viewers, I am posting an implementation of the above algorithm using hash tables, which makes for a much simpler and much more readable solution.

This is the code:


(use-modules (ice-9 format))

(define (digits-table mincnt maxcnt maxit minv maxv)
(let ((layers (make-vector (+ 1 maxit)))
(allsols (make-hash-table))
(initial (make-hash-table)))
(for-each
(lambda (ex-p)
(hash-set! initial (car ex-p) (cdr ex-p)))
'((1 . "1") (7 . "7") (17 . "17") (77 . "77")
(71 . "71")  (777 . "777") (177 . "177")
(717 . "717") (771 . "771")))
(vector-set! layers 0 initial)
(letrec
((insert
(lambda (ht v s)
(let ((ent (hash-ref ht v)))
(if (or (and ent
(> (string-length ent)
(string-length s)))
(not ent))
(hash-set! ht v s)))))
(combine
(lambda (res a b)
(let* ((ha (vector-ref layers a))
(hb (vector-ref layers b)))
(hash-for-each
(lambda (v1 s1)
(hash-for-each
(lambda (v2 s2)
(if (not (and (string-contains s1 "1")
(string-contains s2 "1")))
(begin
(insert
res (+ v1 v2)
(format #f "(~a)+(~a)" s1 s2))
(insert
res (- v1 v2)
(format #f "(~a)-(~a)" s1 s2))
(insert
res (* v1 v2)
(format #f "(~a)*(~a)" s1 s2))
(if (not (zero? v2))
(insert
res (/ v1 v2)
(format #f "(~a)/(~a)" s1 s2))))))
hb)) ha) res)))
(iter
(lambda (k)
(if (not (= maxit k))
(let ((res (make-hash-table)))
(do ((a 0 (1+ a))) ((> a k))
(combine res a (- k a)))
(vector-set! layers (1+ k) res)
(iter (1+ k)))))))
(iter 0)
(letrec
((do-disp
(lambda (l)
(if (not (null? l))
(let ((ex-p (car l)))
(begin
(display
(format #f "~35a ~20a ~8f"
(cdr ex-p) (car ex-p)
(exact->inexact (car ex-p))))
(newline)
(do-disp (cdr l))))))))
(do ((a 0 (1+ a))) ((> a maxit))
(hash-for-each
(lambda (v s) (insert allsols v s))
(vector-ref layers a)))
(do-disp
(filter
(lambda (p)
(and (<= minv (car p)) (<= (car p) maxv)
(<= mincnt (string-count (cdr p) #\7) maxcnt)
(= (string-count (cdr p) #\1) 1)))
(sort
(hash-fold
(lambda (v s prior) (cons (cons v s) prior))
'() allsols)
(lambda (ex-p1 ex-p2)
(< (car ex-p1) (car ex-p2))))))))) '())


This will produce output e.g. like this

guile> (digits-table 7 7 4 300 305)
((77)*((7)+(7)))-((1)+(777))        300                     300.0
(71)+((77)+((77)+(77)))             302                     302.0
(777)/((1)+((77)/((7)*(7))))        1813/6               302.1667
((7)+(77))/((7)/((177)/(7)))        2124/7               303.4286
(77)*(((777)/(71))-(7))             21560/71             303.6620
(71)*((77)/((7)+((77)/(7))))        5467/18              303.7222
()

-
In the above solution the way it's written shorter answers will overwrite longer ones. This behavior is easy to modify (adapt the last merge operation) and left to the reader. Of course a more compact solution in whatever programming language would always be welcome. – Marko Riedel Mar 20 '13 at 23:38
Marko, thank you very much for your time. Not only did you show that there are languages which are good at working with this kind of problem, but gave a sample as well. Many thanks! – Fidel Mar 21 '13 at 12:47

In your case the combinatorial growth is reasonable because your base values are almost all equal, with the exception of the value one. That means tables of solutions can be computed. The algorithm is described here at Wikipedia.

Essentially you need a programming language that supports storing rational numbers in an exact representation as opposed to floating point. Scheme is such a language. The algorithm consists in initializing a table with your base case values, which are numbers with no arithmetic involved, e.g. "1", "7", "17", "77" etc. You then loop over the entries of the table, combining them in pairs with the four arithmetic operations and storing the results that you deem acceptable, e.g. that are the most compact you have seen so far. The fastest implementation uses hash tables with rational numbers as keys. Since Scheme does not provide these we use sorted arrays as an alternative. Once you are finished looping you collect and sort all the entries you have obtained. This can produce a lot of interesting formulas very quickly.

I have implemented the above algorithm in GUILE Scheme (because there are GPLed implementations available, e.g. for Windows and Linux). Here are two tables I have calculated, one of them containing solutions for the OPs question (there is only one solution because my code picks the shortest one):


guile> (load "digits-bst.scm")
guile> (digits-table 3 717 720)
717                                 717                     717.0
(717)+((7)/((777)*(777)))           61839100/86247       717.0000
(717)+((7)/((77)*(777)))            6128200/8547         717.0001
(717)+((77)/((777)*(777)))          61839110/86247       717.0001
(717)+((7)/((77)*(77)))             607300/847           717.0012
(717)+((7)/((7)*(777)))             557110/777           717.0013
(717)+((7)/((777)+(777)))           159175/222           717.0045
(717)+((7)/((77)+(777)))            87475/122            717.0082
(717)+((7)/((7)+(777)))             80305/112            717.0089
(717)+((7)/(777))                   79588/111            717.0090
(717)-((7)/((7)-(777)))             78871/110            717.0091
(717)-((7)/((77)-(777)))            71701/100              717.01
(717)+((7)/((7)*(77)))              55210/77             717.0130
(717)+((77)/((7)*(777)))            557120/777           717.0142
(717)+(((7)+(7))/(777))             79589/111            717.0180
(717)+((7)/((77)+(77)))             15775/22             717.0455
(717)+((77)/((777)+(777)))          159185/222           717.0495
(717)+((7)*((7)/(777)))             79594/111            717.0631
(717)+((7)/((7)+(77)))              8605/12              717.0833
(717)-(((7)-(77))/(777))            79597/111            717.0901
(717)+((77)/((77)+(777)))           87485/122            717.0902
(717)+((7)/(77))                    7888/11              717.0909
(717)+((77)/((7)+(777)))            80315/112            717.0982
(717)+((77)/(777))                  79598/111            717.0991
(717)-((7)/((7)-(77)))              7171/10                 717.1
(717)+(((7)+(77))/(777))            26533/37             717.1081
(717)-((77)/((77)-(777)))           71711/100              717.11
(717)+((777)/((77)*(77)))           607410/847           717.1311
(717)+((7)/((7)*(7)))               5020/7               717.1429
(717)+(((7)+(7))/(77))              7889/11              717.1818
(717)+(((77)+(77))/(777))           79609/111            717.1982
((77)+((71)*(777)))/(77)            7892/11              717.4545
(717)+((7)/((7)+(7)))               1435/2                  717.5
(717)+((7)*((7)/(77)))              7894/11              717.6364
(717)+((7)*((77)/(777)))            79664/111            717.6937
(717)-(((77)-(777))/(777))          79687/111            717.9009
(717)-(((7)-(77))/(77))             7897/11              717.9091
(717)+((777)/((77)+(777)))          87585/122            717.9098
(717)+((77)/((7)+(77)))             8615/12              717.9167
(717)-(((7)-(777))/(777))           79697/111            717.9910
(717)+((777)/((7)+(777)))           80415/112            717.9911
(717)+((7)/(7))                     718                     718.0
(717)-((777)/((7)-(777)))           78981/110            718.0091
(717)-((77)/((7)-(77)))             7181/10                 718.1
(717)-((777)/((77)-(777)))          71811/100              718.11
(717)+((777)/((7)*(77)))            55320/77             718.4416
(717)+((77)/((7)*(7)))              5030/7               718.5714
(7)-((71)-((7)+(777)))              720                     720.0
()
guile> (digits-table 3 99 101)
(1)+((7)*((7)+(7)))                 99                       99.0
((771)-(77))/(7)                    694/7                99.14286
(77)/(((777)-(177))/(777))          19943/200              99.715
((777)-((1)+(77)))/(7)              699/7                99.85714
(177)-((77)+((77)/(777)))           11089/111            99.90090
(177)-((77)+((7)/(77)))             1099/11              99.90909
(177)-((77)+((7)/(777)))            11099/111            99.99099
(177)-(77)                          100                     100.0
(177)+(((7)/(777))-(77))            11101/111            100.0090
((771)/(7))-((777)/(77))            7704/77              100.0519
((777)/(7))-((777)/(71))            7104/71              100.0563
(177)+(((7)/(77))-(77))             1101/11              100.0909
(177)+(((77)/(777))-(77))           11111/111            100.0991
((1)-((77)-(777)))/(7)              701/7                100.1429
((717)-((7)+(7)))/(7)               703/7                100.4286
((777)-(71))/(7)                    706/7                100.8571
(777)*(((17)-(7))/(77))             1110/11              100.9091
((777)/(7))-((771)/(77))            7776/77              100.9870
(717)/((7)+((77)/(777)))            79587/788            100.9987
(7)+((17)+(77))                     101                     101.0
()
guile> (digits-table 4 500 510)
((77)-(7))*((7)+((1)/(7)))          500                     500.0
((771)/(77))-((7)*((7)-(77)))       38501/77             500.0130
((777)/(77))-((7)*((7)-(77)))       5501/11              500.0909
((71)/(7))-((7)*((7)-(77)))         3501/7               500.1429
(71)*((7)+((7)/((77)+(77))))        11005/22             500.2273
((77)*((7)-((7)/(17))))-(7)         8505/17              500.2941
(77)*((7)-((777)/((777)+(771))))    258181/516           500.3508
(7)*((71)+((7)/((7)+(7))))          1001/2                  500.5
(71)*((7)+((77)/((777)+(777))))     111115/222           500.5180
((777)+((7)*((7)*(771))))/(77)      5508/11              500.7273
(77)*((7)-((771)/((777)+(777))))    37059/74             500.7973
((777)+(771))/(((777)/(77))-(7))    8514/17              500.8235
(7)/((77)/((71)+((7)*(777))))       5510/11              500.9091
((777)/(71))-((7)*((7)-(77)))       35567/71             500.9437
(7)/(((77)-(1))/((7)*(777)))        38073/76             500.9605
((77)/(7))-((7)*((7)-(77)))         501                     501.0
(77)*(((77)/((71)/(77)))-(77))      35574/71             501.0423
((7)*((77)-((777)/(177))))-(7)      29575/59             501.2712
(7)*((71)+((7)*((7)/(77))))         5516/11              501.4545
(71)*((7)+((7)*((7)/(777))))        55664/111            501.4775
(7)/(((777)-(7))/((71)*(777)))      55167/110            501.5182
(((77)/((17)/(777)))-(7))/(7)       8530/17              501.7647
(7)*((71)+((7)*((77)/(777))))       55706/111            501.8559
(7)/(((77)-(7))/((7)*(717)))        5019/10                 501.9
(777)-((177)+((7)*((7)+(7))))       502                     502.0
((7)*(71))+((777)/((77)+(77)))      11045/22             502.0455
(7)/((777)/((77)*((7)+(717))))      55748/111            502.2342
(7)*((77)-((777)/((77)+(71))))      2009/4                 502.25
(((77)/((7)/(777)))-(7))/(17)       8540/17              502.3529
(77)*((7)-(((7)+(77))/(177)))       29645/59             502.4576
((7)*(71))+((77)/((7)+(7)))         1005/2                  502.5
(((77)*(777))-(7))/((7)*(17))       8546/17              502.7059
((7)*(77))-(((77)+(177))/(7))       3519/7               502.7143
(77)/((7)*((17)/(777)))             8547/17              502.7647
((7)+((77)*(777)))/((7)*(17))       8548/17              502.8235
(71)*((7)+((7)/((7)+(77))))         6035/12              502.9167
(7)-(((7)/(7))-((7)*(71)))          503                     503.0
(77)/(((7)+((777)/(7)))/(771))      59367/118            503.1102
((7)+((77)/((7)/(777))))/(17)       8554/17              503.1765
(7)-((7)*(((77)/(777))-(71)))       55867/111            503.3063
((7)+(77))*((7)-((777)/(771)))      129360/257           503.3463
(7)-((71)*(((7)/(777))-(7)))        55873/111            503.3604
(7)-((7)*(((7)/(77))-(71)))         5537/11              503.3636
(7)*((71)+((777)/((77)+(777))))     61411/122            503.3689
(71)*((7)-(((7)-(77))/(777)))       55877/111            503.3964
(71)*((7)+((77)/((77)+(777))))      61415/122            503.4016
(7)*((71)+((77)/((7)+(77))))        6041/12              503.4167
(71)*((7)+((7)/(77)))               5538/11              503.4545
(77)*((7)-((717)/((777)+(777))))    37257/74             503.4730
(7)*((77)-((71)/((7)+(7))))         1007/2                  503.5
(7)*((77)-((777)/((77)+(77))))      11081/22             503.6818
((7)+((77)/((17)/(777))))/(7)       8564/17              503.7647
((717)+((7)*((7)*(777))))/(77)      38790/77             503.7662
(7)-(((77)/(777))-((7)*(71)))       55933/111            503.9009
(7)-(((7)/(77))-((7)*(71)))         5543/11              503.9091
(7)-((7)*(((7)/(777))-(71)))        55937/111            503.9369
(7)*((71)+((777)/((7)+(777))))      8063/16              503.9375
(7)*((77)-((771)/((77)+(77))))      11087/22             503.9545
(71)*((7)+((77)/((7)+(777))))       56445/112            503.9732
(7)-(((7)/(777))-((7)*(71)))        55943/111            503.9910
(7)+((7)*(71))                      504                     504.0
(7)+(((7)/(777))+((7)*(71)))        55945/111            504.0090
(71)*((7)+((77)/(777)))             55948/111            504.0360
(7)+((7)*((71)+((7)/(777))))        55951/111            504.0631
(7)*((71)-((777)/((7)-(777))))      55447/110            504.0636
(7)+(((7)/(77))+((7)*(71)))         5545/11              504.0909
(7)+(((77)/(777))+((7)*(71)))       55955/111            504.0991
(71)*((7)-((7)/((7)-(77))))         5041/10                 504.1
(77)*((7)+((77)/((7)-(177))))       85701/170            504.1235
(7)+((7)/((777)/((77)*(717))))      18662/37             504.3784
(7)*((77)-(((7)+(77))/(17)))        8575/17              504.4118
((771)+((7)*((7)*(777))))/(77)      38844/77             504.4675
(777)*(((1)+((7)*(7)))/(77))        5550/11              504.5455
((7)*(71))+((77)*((77)/(777)))      56014/111            504.6306
(7)+((7)*((71)+((7)/(77))))         5551/11              504.6364
(7)+((71)*((7)+((7)/(777))))        56015/111            504.6396
((7)+(77))*((7)-((771)/(777)))      18672/37             504.6486
(71)*((7)+(((7)+(77))/(777)))       18673/37             504.6757
(7)+((7)*((71)+((77)/(777))))       56021/111            504.6937
(7)*((71)-((77)/((7)-(77))))        5047/10                 504.7
(7)*((71)-((777)/((77)-(777))))     50477/100              504.77
(71)*((7)-((77)/((77)-(777))))      50481/100              504.81
(7)+(((7)/(7))+((7)*(71)))          505                     505.0
(77)/((777)/((77)+((7)*(717))))     56056/111            505.0090
(7)*((77)-(((77)+(777))/(177)))     89425/177            505.2260
(77)-(((77)/((17)/(77)))-(777))     8589/17              505.2353
(7)*((7)+((7)/((77)/(717))))        5558/11              505.2727
((77)-(7))*((7)+((17)/(77)))        5560/11              505.4545
(77)*((7)-((77)/(177)))             89474/177            505.5028
(77)-(((771)/(7))-((7)*(77)))       3541/7               505.8571
((77)-(7))*((7)+((177)/(777)))      18720/37             505.9459
(777)/(((717)/((7)+(77)))-(7))      21756/43             505.9535
(771)-((77)+((77)+((777)/(7))))     506                     506.0
(777)+((7)*((7)-((777)/(17))))      8603/17              506.0588
(7)*((77)+(((177)/(77))-(7)))       5567/11              506.0909
((7)*(71))+((777)/((7)+(77)))       2025/4                 506.25
(71)*((7)+((777)/((77)*(77))))      428840/847           506.3046
(7)*((77)-((717)/((77)+(77))))      11141/22             506.4091
((7)*(77))-((777)/((7)+(17)))       4053/8                506.625
((7)*(77))-((7)+((177)/(7)))        3547/7               506.7143
(77)*((7)-((77)/((7)+(177))))       93247/184            506.7772
(777)*(((77)+(777))/((17)*(77)))    94794/187            506.9198
(17)-((7)*((7)-(77)))               507                     507.0
(7)*((77)+((777)/((7)-(177))))      86191/170            507.0059
(77)/(((7)/(777))+((1)/(7)))        59829/118            507.0254
((777)/(77))+((7)*(71))             5578/11              507.0909
((7)/((717)/((77)*(777))))-(77)     121198/239           507.1046
(71)*((7)+((7)/((7)*(7))))          3550/7               507.1429
((7)*(71))+(((7)+(777))/(77))       5579/11              507.1818
(77)*((7)-((7)/(17)))               8624/17              507.2941
(777)*((777)/((7)*((177)-(7))))     86247/170            507.3353
(777)*(((7)-((17)/(7)))/(7))        3552/7               507.4286
(7)*((17)+((777)/((7)+(7))))        1015/2                  507.5
((7)/((71)/((77)*(77))))-(77)       36036/71             507.5493
((7)*(77))+(((777)/(17))-(77))      8631/17              507.7059
(7)/((71)/(((77)*(77))-(777)))      36064/71             507.9437
(7)*((77)-(((7)+(777))/(177)))      89915/177            507.9944
((77)/(7))+((7)*(71))               508                     508.0
((7)*(71))-((777)/((7)-(77)))       5081/10                 508.1
(7)*((77)-((777)/(177)))            29988/59             508.2712
(77)*((7)+(((7)-(77))/(177)))       90013/177            508.5480
(77)*(((77)/(7))-((777)/(177)))     30030/59             508.9831
((7)*((7)*((7)+(7))))-(177)         509                     509.0
(7)*((77)-((777)/((7)+(177))))      93737/184            509.4402
(7)+((77)/((7)*((17)/(777))))       8666/17              509.7647
(71)*((7)+(((7)+(7))/(77)))         5609/11              509.9091
((7)*((7)+(77)))-((1)+(77))         510                     510.0
()
guile>


This is the code.


(use-modules (ice-9 format))

(define (digits-table maxit minv maxv)
(let ((layers (make-vector (+ 1 maxit))) (allsols '()))
(set! allsols
(list
'((1 . "1") (7 . "7") (17 . "17") (77 . "77")
(71 . "71")  (777 . "777") (177 . "177")
(717 . "717") (771 . "771"))))
(vector-set! layers 0 (list->vector (car allsols)))
(letrec
((num-pred?
(lambda (ex-p1 ex-p2)
(or (> (car ex-p1) (car ex-p2))
(and (= (car ex-p1) (car ex-p2))
(< (string-length (cdr ex-p1))
(string-length (cdr ex-p2)))))))
(dup-pred?
(lambda (ex-p1 ex-p2)
(and (= (car ex-p1) (car ex-p2))
(>= (string-length (cdr ex-p1))
(string-length (cdr ex-p2))))))
(remove-duplicates
(lambda (l acc)
(if (null? l) acc
(if (null? acc) (remove-duplicates (cdr l) (list (car l)))
(if (dup-pred? (car l) (car acc))
(remove-duplicates (cdr l) acc)
(remove-duplicates (cdr l) (cons (car l) acc)))))))
(flatten-depth-2
(lambda (l)
(let ((res '()))
(map (lambda (subl)
(map (lambda (el)
(set! res (cons el res))) subl)) l) res)))
(combine
(lambda (a b)
(let* ((res '())
(va (vector-ref layers a))
(vb (vector-ref layers b)))
(do ((i 0 (1+ i)))
((>= i (vector-length va)))
(do ((j 0 (1+ j)))
((>= j (vector-length vb)))
(let ((left (vector-ref va i))
(right (vector-ref vb j)))
(if (not (and (string-contains (cdr left) "1")
(string-contains (cdr right) "1")))
(begin
(set! res
(cons
(cons (+ (car left) (car right))
(format
#f "(~a)+(~a)"
(cdr left) (cdr right))) res))
(set! res
(cons
(cons (* (car left) (car right))
(format
#f "(~a)*(~a)"
(cdr left) (cdr right))) res))
(set! res
(cons
(cons (- (car left) (car right))
(format
#f "(~a)-(~a)"
(cdr left) (cdr right))) res))
(if (not (zero? (car right)))
(set! res
(cons
(cons (/ (car left) (car right))
(format
#f "(~a)/(~a)"
(cdr left) (cdr right)))
res)))))))) res)))
(iter
(lambda (k)
(if (not (= maxit k))
(let ((allatk '()))
(do ((a 0 (1+ a))) ((> a k))
(set! allatk
(cons (combine a (- k a)) allatk)))
(let ((flat
(remove-duplicates
(sort (flatten-depth-2 allatk) num-pred?) '())))
(vector-set!
layers (1+ k)
(list->vector flat))
(set! allsols (cons flat allsols)))
(iter (1+ k)))))))
(iter 0)
(letrec
((do-disp
(lambda (l)
(if (not (null? l))
(let ((ex-p (car l)))
(begin
(display
(format #f "~35a ~20a ~8f"
(cdr ex-p) (car ex-p)
(exact->inexact (car ex-p))))
(newline)
(do-disp (cdr l))))))))
(do-disp
(filter
(lambda (p) (and (<= minv (car p)) (<= (car p) maxv)))
(remove-duplicates
(sort (flatten-depth-2 allsols) num-pred?) '())))))) '())

-
While similar ideas can certainly be used to good effect, this answer doesn't meet the original post's constraints that precisely four 7s and a single 1 be used. – Steven Stadnicki Mar 20 '13 at 0:51

In response to the comment it is certainly possible to calculate the table for the case of exactly four 7s and a single 1.

These are the changes that need to be made.

\$ diff digits-bst.scm digits-bst-lim.scm
4c4
< (define (digits-table maxit minv maxv)
---
> (define (digits-table count maxit minv maxv)
107c107,110
<         (lambda (p) (and (<= minv (car p)) (<= (car p) maxv)))
---
>         (lambda (p)
>           (and (<= minv (car p)) (<= (car p) maxv)
>                (= (string-count (cdr p) #\7) count)
>                (= (string-count (cdr p) #\1) 1)))



This will produce the following output:

guile> (digits-table 4 3 254 500)
(77)+(177)                          254                     254.0
((7)*((7)*(7)))-(71)                272                     272.0
((7)*((7)*(7)))-(17)                326                     326.0
(17)*((7)+((7)+(7)))                357                     357.0
(17)+((7)*((7)*(7)))                360                     360.0
(7)*((71)-((7)+(7)))                399                     399.0
(71)+((7)*((7)*(7)))                414                     414.0
(7)*((77)-(17))                     420                     420.0
(71)*((7)-((7)/(7)))                426                     426.0
(7)-((7)*((7)-(71)))                455                     455.0
((7)*(77))-(71)                     468                     468.0
(7)-((77)*((1)-(7)))                469                     469.0
(7)*((77)-((1)+(7)))                483                     483.0
((7)*((77)-(7)))-(1)                489                     489.0
(1)-((7)*((7)-(77)))                491                     491.0
((7)*(71))-((7)/(7))                496                     496.0
((7)/(7))+((7)*(71))                498                     498.0
()


Or this:

guile> (digits-table 6 3 119 150)
((7)/(777))+((7)*(17))              13210/111            119.0090
(7)*((17)+((7)/(777)))              13216/111            119.0631
(17)*((7)+((7)/(777)))              13226/111            119.1532
((77)-((7)-(771)))/(7)              841/7                120.1429
(7)+(((17)+(777))/(7))              843/7                120.4286
((77)-((1)-(777)))/(7)              853/7                121.8571
((1)+((77)+(777)))/(7)              855/7                122.1429
(77)+((777)/(17))                   2086/17              122.7059
(1)+(((77)+(777))/(7))              123                     123.0
(7)*((7)+((777)/(71)))              8918/71              125.6056
(71)+((777)/((7)+(7)))              253/2                   126.5
(7)+(((77)+(771))/(7))              897/7                128.1429
(77)+((717)/((7)+(7)))              1795/14              128.2143
(717)*(((7)+(7))/(77))              1434/11              130.3636
(77)+((771)/((7)+(7)))              1849/14              132.0714
((777)+(177))/(7)                   954/7                136.2857
(771)*(((7)+(7))/(77))              1542/11              140.1818
((77)+(777))/((7)-(1))              427/3                142.3333
(77)-(((71)/(7))-(77))              1007/7               143.8571
(7)-((17)-((77)+(77)))              144                     144.0
(77)-(((7)/(77))-(71))              1627/11              147.9091
(77)+((71)+((7)/(77)))              1629/11              148.0909
()

-