## Teaser 2976: Piece of cake

**From The Sunday Times, 6th October 2019** [link]

Using her special recipe, so that each cubic inch of baked cake weighed one ounce, Mam made the cake for my eighth birthday party. It had a regular octagonal flat top and base, and equal square vertical faces, several inches high exactly.

Not all (but a majority) of the dozen invited pals came to the party. We each had an equal portion of cake (the largest whole number of ounces possible from it, a two-figure number). Mam had the leftover cake. Curiously, if one more or one fewer pal had turned up and our portions had been worked out in the same way, Mam’s leftover would have been the same in each case, but less than she actually got.

How large, in ounces, was my portion?

[teaser2976]

## Jim Randell 5:38 pm

on4 October 2019 Permalink |12 people were invited, and more than half but not all came, so between 7 and 11. If we include the setter as well the cake is divided into between 8 and 12 integer portions.

We can ignore the fractional part of the volume as it is always included in the leftover portion of cake. So we just need to consider the integer part of the remaining portion.

This Python program runs in 87ms.

Run:[ @repl.it ]Solution:The portion size was 54 ounces.It seems like quite a large portion, but I suppose any 2-digit number of ounces is quite a weighty piece of cake.

Of the 12 invited guests, 10 attended, meaning that the cake was divided into 11 integer portions.

The cake has vertical faces that are squares measuring 5 inches along each side, so would require a round cake tin just over 13 inches in diameter to fit it in. It would weigh just over 603.5 ounces (about 17.1 kg).

We only need to look at the cases where the cake is between 3 and 6 inches high, and there are four possibilities where the leftover portions would have been equal if one fewer or one more guest had attended:

Only the last of these has a hypothetical leftover portion that is smaller than the actual leftover portion, so this gives rise to the solution.

LikeLike