The Lazy Caterer 's Problem | This function returns the maximum number of pieces that can be made form pancake using n cuts ; Use the formula ; Driver Code
function findPieces ( n ) { return ( n * ( n + 1 ) ) / 2 + 1 ; } document . write ( findPieces ( 1 ) + " " ) ; document . write ( findPieces ( 2 ) + " " ) ; document . write ( findPieces ( 3 ) + " " ) ; document . write ( findPieces ( 50 ) ) ;