Sunday Times Teaser 2548 – Planetary Line
by Danny Roth
Published: 24 July 2011 (link)
George and Martha are studying a far- off galaxy consisting of 10 planets circling a sun clockwise, all in the same plane. The planets are Unimus (taking one year to circle the sun), Dubious (two years), Tertius (three years), and so on up to Decimus (10 years). At one instant today the sun and all 10 planets were in one straight line. Martha said it will be ages before that happens again. “Don’t let’s be greedy,” said George. “How long must we wait until at least nine planets and the sun are in a straight line?”
How long must they wait?
One Comment
Leave one →
-
Brian Gladman permalink123456789101112131415161718from number_theory import lcm# The planets will line after a number of years that# is divible by the periods of all the planets being# considered in the line up. At this point all the# planets will return to their initial aligment. But# they will also line up in one half this time since# they will then be at either 180 or 360 degrees in# their orbits and will be in a line (although in# this case not all on the same side of the sun# find the lowest common multiples with one planet# omittedtimes = [lcm(*set(range(1, 11)).difference([x]))for x in range(1, 11)]print('They will wait {} years.'.format(min(times) // 2))