TITLE: Dividing a cake between $n-1$, $n$, or $n+1$ guests
QUESTION [34 upvotes]: A housewife is waiting for guests and has prepared a cake. She doesn't know how many guests will come, but it will be $n-1$, $n$, or $n+1$. 
  What is the minimal number $f(n)$ of pieces the cake should be cut to make it possible to divide between guests equally?

For $n=2$, $f(n)=f(2)=4$:

The problem was posed 16.10.2018 by Oleksandr Maksymets on page 76 of Volume 2 of the Lviv Scottish Book.
The prize: Cooked duck or lunch + beer!

REPLY [4 votes]: $f(6) = 13$ with a cake of size $210$ and piece sizes:
$$\{3, 5, 8, 10, 12, 13, 17, 18, 20, 22, 25, 27, 30\},$$
where
$$17+25 = 5+10+27 = 20 + 22 = 3+8+13+18 = 12+30,$$
$$10+25 = 5+30 = 3+12+20 = 17+18 = 13 + 22 = 8+27,$$
$$5+25 = 3+27 = 10+20 = 12+18 = 13+17 = 30 = 8+22.$$
It was computed with via solving MILP as explained in my other answer.