Lazy Caterer's sequence
Problem
Given a circular (or regular polygon) cake and a knife by which you can only cut vertically, find the maximum number of pieces of cake you can get by making n cuts. Write a program to do that.
Solution
The solution to this is very simple, if you know mathematics. :P
Number of pieces p
p = ( n^2+n+2)/2 p = C(n+1,2) + 1 ``` More on wikipedia - [http://en.
[Read More]