Hello I'm having a little trouble solving this problem, and would like to ask if someone can help me. A mop expression is a way of producing a number using only multiplications, ones and pluses. The length of a mop is the number of ones it contains. For example, 22 = 1+1+((1+1+1+1)x(1+1+1+1+1)), which has a length of 11. Another mop of 22 is 1+((1+1+1)x(1+((1+1)x(1+1+1)))) which has a length of 10. There are no shorter mops for 22. DERIVE A METHOD that inputs a single integer n (1<n<10000) and outputs the length of the shortest mop of n. Thankyou for anyone who has a look at this Gerg
(1+1)x(1+((1+1)x(1+1+1+1+1)))=22 [length=10] (1+1)x(1+1+((1+1+1)x(1+1+1)))=22 [length=10] Any “mop” should satisfy n=C+(XxY) where C,X,Y are recursive “mop”s the sum of the resulting “mop” values C+X+Y is the length. Prime case P: initial C must be >0 (XxY)= lower number “mop” Factorable case: initial C can be 0 Find factors “mop”s {X,Y}>=2 Take the factors distribute them between X and Y For every distribution find the lowest length “mop”s A table of lower order “mop”s would be helpful.
ooh, thanks for that - this will help a lot with the programing of a computer program to solve the problem. Gerg