Thjank you for your correction by lessening of my list by 2+1 from both ends which makes life even easier.

I must say I have been enjoying Sunday Times teasers aklmost right from the beginning but I do miss the Observer “Brain Twisters” of the 1960’s by Dr. Barnard and never continued after his farewell to life.

Still this is what we have and carry on dancing.

Have a nice Easter.

ahmet

Your list is longer than it needs to be.

22 is not possible because this only leaves 15 for the sum of the other two. So the smaller of these has to be 7 or less and the maximum hence has to be less than 21, which it isn’t.

The same is true for 21 so the maximum value is 19/ 37 (as you suggest, 20 isn’t possible).

Similarly if the smallest is 5/37, the other two sum to 32/37 and this makes the maximum at least 16/37. But this is not possible because it is larger than 15 – three times the smallest.

So the minimum is 6/37 and the maximum is 19/37.

]]>5/37=0.135.. , 6/37=0.162.. , 7/37=0.189.. , 8/37=0.216.. , 9/37=0.243.. , 11/37=0.297.. , 12/37=0.324.. , 13/37=0.351.. , 14/37=0.378.. , 16/37=0.432.. , 17/37=0.459.. , 18/37=0.486.. , 19/37=0.513.. , 21/37=0.567.. , 22/37=0.594.. ]]>

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
from fractions import Fraction # if the fraction f has the form 0.ABCABC... then: # f = ABC / 1000 + ABC / 1000^2 + .... = ABC / 999 # the first value for ABC in range(1, 333): # the second value for DEF in range(ABC + 1, (999 - ABC) // 2): # the third value GHI = 999 - ABC - DEF # apply the constraints if DEF < GHI < 3 * ABC: # check that all digits in (1 .. 9) are used in the decimals if set(str(ABC) + str(DEF) + str(GHI)) == set('123456789'): # now convert to fractions t = tuple(Fraction(x, 999) for x in (ABC, DEF, GHI)) if t[0].denominator == t[1].denominator == t[2].denominator: if all(x.numerator < 100 for x in t): f = ((x.numerator, x.denominator) for x in t) s = ' and '.join('/'.join(str(x) for x in y) for y in f) print('The shares are', s.replace(' and ', ', ', 1)) |