Skip to content

Sunday Times Teaser 3138 – Primus Inter Impares

by BRG on November 11, 2022

by Edmund Marshall

Published Sunday November 13 2022 (link)

Just nine Prime Ministers held office in the Kingdom of Primea during the 20th century. No two Prime Ministers held office at the same time, none had more than one period in office, and the gap between successive Prime Ministers’ terms was never more than a month. Each held office for a period of time in which the number of whole years was a different prime number (eg holding office from 1910 to 1915 could cover four or five whole years) and no Prime Minister served for more than 30 years. Appropriately, they all took office in prime years, but there was no change of Prime Minister in 1973.

In which years during the 20th century did new Prime Ministers in Primea take up office?

From → Uncategorized

6 Comments Leave one →
  1. Brian Gladman permalink

    I can understand Frtis’s feeling on this. The logic is OK but it would probably be less surprising if it was expressed in the form:

  2. Brian Gladman permalink

    Recursion is faster

  3. John Z permalink

    • John Z permalink

      The use of the same value in two separate parameters of the ‘findpm’ recursive function in my code above bothers me. Brian: what’s your opinion on this?

      I have rewritten my code to avoid doing this. See below after GeoffR’s entry.

      • Brian Gladman permalink

        This doesn’t really worry me too much as it will often simplify the code
        elsewhere. So its largely a matter of personal choice. The interleaving
        of inhomogeneous data (years and year differences) in a list is another
        such approach that is largely the same although I tend to avoid it.

  4. John Z permalink

    Rewrite of my code to unify parameter passing.

Leave a comment to John Z Cancel reply

Note: HTML is allowed. Your email address will not be published.

Subscribe to this comment feed via RSS