PROJECT EULER · #0726
Falling Bottles
Consider a stack of bottles of wine. There are

The collapsing process happens every time a bottle is taken. A space is created in the stack and that space is filled according to the following recursive steps:
- No bottle touching from above: nothing happens. For example, taking
. - One bottle touching from above: that will drop down to fill the space creating another space. For example, taking
. - Two bottles touching from above: one will drop down to fill the space creating another space. For example, taking
.
This process happens recursively; for example, taking bottle
Define
You are given
Also define
Find
Write-up coming later
The complete problem is available here. An approach, code, and answer will be added later.