Tagged: by: Nick Jones Toggle Comment Threads | Keyboard Shortcuts

  • Unknown's avatar

    Jim Randell 8:15 am on 13 February 2026 Permalink | Reply
    Tags: by: Nick Jones   

    Teaser 2458: [Chocolate cylinders] 

    From The Sunday Times, 1st November 2009 [link]

    Willy took a cylindrical cake of radius a whole prime number of millimetres. He coated the curved surface with a layer of chocolate an odd prime number of millimetres thick and let it set. He repeated this a few times, building up layers of the same thickness. Being a silly Willy, he then left the cake in the sun and all the chocolate melted. So he used it to make nine solid cylinders of chocolate, each of radius 20 mm and length the same as the original cake.

    How many layers of chocolate did he apply to the cake?

    This puzzle was originally published with no title.

    [teaser2458]

     
    • Jim Randell's avatar

      Jim Randell 8:15 am on 13 February 2026 Permalink | Reply

      Suppose the cake has radius r and height h.

      Then, if n layers of chocolate, each of thickness t, are added, the total volume of chocolate used is:

      V = 𝝅 (r + n.t)^2 h − 𝝅 r^2 h

      And this same volume can also be used to make 9 solid cylinders of chocolate, each with a radius of 20 mm:

      V = 9 𝝅 20^2 h

      Hence:

      𝝅 (r + n.t)^2 h − 𝝅 r^2 h = 9 𝝅 20^2 h
      (r + n.t)^2 − r^2 = 60^2

      The LHS is the difference of 2 squares, so can be rewritten:

      (n.t)(2r + n.t) = 60^2

      So we can solve the puzzle by looking at the divisors of 60^2.

      The following Python program runs in 68ms. (Internal runtime is 96µs).

      from enigma import (divisors_pairs, div, is_prime, printf)
      
      # consider divisors of 3600
      for (a, b) in divisors_pairs(60, 2):
        r = div(b - a, 2)
        if r is None or not is_prime(r): continue
      
        printf("r={r} [nt={a}]")
        for (n, t) in divisors_pairs(a, every=1):
          if not (t % 2 == 1 and is_prime(t)): continue
          printf("-> n={n} t={t}")
      

      Solution: Willy applied 10 layers of chocolate to the cake.

      The situation is apparently:

      cake radius = 11 mm
      layer thickness = 5 mm
      number of layers = 10

      So the cake is only 22 mm across, and it was then coated with 10 layers of 5 mm chocolate. Which means the finished item was 122 mm across with only a tiny 22 mm centre consisting of cake.

      Like

    • Ruud's avatar

      Ruud 9:48 am on 13 February 2026 Permalink | Reply

      import peek
      import istr
      
      for r, d, n in istr.product(istr.primes(1000), istr.primes(3, 1000), range(2, 20)):
          if (r + n * d) ** 2 - r**2 == 9 * (20**2):
              peek(r, n, d)
      

      Like

  • Unknown's avatar

    Jim Randell 4:32 pm on 18 January 2023 Permalink | Reply
    Tags: by: Nick Jones   

    Teaser 2708: Abracadabra 

    From The Sunday Times, 17th August 2014 [link] [link]

    In his magic cave Ali Baba discovers a string necklace comprising sixty various gold beads that he decides to melt down and turn into coins. Each bead is spherical but with a cylindrical hole symmetrically cut through it, and in each bead the hole is one centimetre long. Ali Baba melts down all these beads and makes the gold into circular coins of two centimetres diameter and half a centimetre thickness.

    How many coins does he obtain?

    [teaser2708]

     
    • Jim Randell's avatar

      Jim Randell 4:33 pm on 18 January 2023 Permalink | Reply

      If we start with a sphere of radius R, and bore a hole through it of radius r (from north pole to south pole) then we are left with a shape (known as a “napkin ring”), and we wish to determine its volume.

      First we note that the height of the napkin ring is given by the value 2h, where:

      h² = R² − r²

      Now consider a 2-dimensional slice through the napkin ring parallel to the equator of the sphere (i.e. along a line of latitude), at a height of y above (or below) the equator.

      The area of the circle belonging to the original sphere is:

      A = 𝛑 (R² − y²)

      And the area removed by the hole is (independent of y):

      a = 𝛑 r²

      And the area of the slice at height ±y is:

      S = 𝛑 (R² − y² − r²)

      or in terms of h:

      S = 𝛑 (h² − y²)

      So the area of slice depends only on h (the semi-height of the napkin ring) and y (the latitude at which the slice is taken).

      This means if we have two napkin rings with different (R, r) values, but the same h value, then the areas of cross-sections through the rings at latitudes in the interval [−h, h] will always be the same.

      We may then apply the 3-dimensional version of Cavalieri’s principle [@wikipedia] to deduce that two napkin rings with same height also have the same volume.

      And we can calculate this volume by considering a napkin ring with height 2h and a hole with radius 0. This is just a complete sphere with radius h.

      Hence the volume of any napkin ring with height 2h is:

      V = (4/3) 𝛑 h³


      So in this puzzle, it does not matter that we are only given the length of the hole through each bead. Each of the beads will have the same volume, even if they are based on spheres with different radii (the holes would also have to have different radii in order to give matching heights).

      Each of the beads has a height of 10mm, so the volume of each bead (in mm³) is:

      B = (4/3) 𝛑 (5³)
      B = (500/3) 𝛑

      And there are 60 beads, giving a total volume of gold (in mm³):

      G = 60B = 10000 𝛑

      Each coin produced has a radius of 10mm and a height of 5mm, so the volume (in mm³) of each coin is:

      C = 𝛑 (10²) 5 = 500 𝛑

      And the number of coins that can be produced (if there is no wastage) is:

      N = G / C = 20

      Hence:

      Solution: 20 coins can be made.


      See also: Napkin ring problem at Wikipedia.

      Like

c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel
Design a site like this with WordPress.com
Get started