Skip to content

Sunday Times Teaser 2690 – Leaving Present

by Graham Smithers

When our maths teacher retired, his colleagues gave him a number of packs of spring bulbs, each pack containing 65 bulbs.  He planted all these bulbs in groups, each group having a different prime number of bulbs. It turned out that each of the digits 0 to 9 appeared exactly once among these primes, a result that would have been impossible with fewer packs.

How many bulbs were there in the smallest and largest groups?

4 Comments Leave one →
  1. brian gladman permalink

    This teaser is a bit more interesting than those we have seen recently because it can be tackled in two distinctly different ways. Here is a conventional but somewhat slower solution using a recursive search:

    However the teaser can also be cast as a linear programming problem that can be solved using the GNU Linear Programming Kit (GLPK) described here:

  2. Paul permalink

    Hi Brian

    I’m not a python programmer so can’t check your solution, and as you requested no solutions from other languages I won’t submit my 2 liner in MMa, but I may be wrong,

    so is 2 and 6089 in the ball park?



  3. Brian Gladman permalink

    Hi Paul,

    The answer to this teaser is: 5 and 401 (5, 23, 67, 89, 401).

    I am sorry that my desire to keep this site focussed on Python has impacted on you but I really don’t want to see a dilution of this focus. I am, however, considering, opening up the site for MiniZinc, a constraint programming language.

    I should add that I am a Mathematica user and quite an enthusiast (I have even provided code for Wolfram at one point). So I have nothing against it.

    But while someone who writes in Python, Fortran, C or C++ can have a reasonable chance of understanding code in any of these, Mathematica code is almost certain to mean nothing to them!

  4. Paul permalink

    Hi Brian

    Thank you for the reply and do appreciate your desire to remain a python only zone:). Now back to this problem, I must have read it wrong but the way I see it is the product of those numbers you gave are not a multiple of 65. The wording also says he planted all of these bulbs which by default would mean he used all n x 65 bulbs.

Leave a Reply

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

Subscribe to this comment feed via RSS