Place any number of parentheses into $1\div2\div3\div4\div5\div6\div7\div8\div9\div10$ to get the number $256/63$

89 Views Asked by At

Place any number of parentheses into this expression to get the number $256/63$

$$1\div2\div3\div4\div5\div6\div7\div8\div9\div10$$

I was able to get $63/256$, but I don't know how I would get the reciprocal.

2

There are 2 best solutions below

1
On

Just to make sure there is no mistake in an argument, here is a Python program which does the brute force search:

def gcd(x, y):
    if x<y: return gcd(y,x)
    if y==0: return x
    return gcd(y, x%y)


def fracs(lower, upper):
    if lower == upper:
        yield lower, 1, str(lower)
    for i in range(lower, upper):
        for n1, d1, s1 in fracs(lower, i):
            for n2, d2, s2 in fracs(i+1, upper):
                g = gcd(n1*d2, n2*d1)
                yield n1*d2//g, n2*d1//g, f"({s1}/{s2})"


for n, d, s in fracs(1, 10):
    print(f"{n}/{d} : {s}")
    

Intuitively, $\text{fracs}(i,j)$ produces (yields) the results as triplets (numerator, denominator, string expression) for a problem $i\div(i+1)\div\cdots\div(j-1)\div j$, and so it is launched as $\text{fracs}(1,10)$.

Sure enough, the output has $4862$ lines ($9$th Catalan number), and many of them ($143$ of them) are showing $63/256$, e.g.:

63/256 : (1/(2/(3/(4/(5/(6/(7/(8/(9/10)))))))))

but there are none showing $256/63$.

2
On

You can't do it. You need all the even numbers in the numerator, to produce $256=2^8$. In particular, $2$ has to be in the numerator. But no arrangment of parentheses can make that happen.