So I was thinking if it's possible to know how many nodes exist on a particular binary tree level mathematically.
I came with the formula (where $n$ is the level): $$2^{n-1}$$
But I didn't consider the fact that few of the parent node could not have leaf at all. Programmatically one would simply go over the parent node and count the leaf nodes, but I'm wondering if there is a way to define it mathematically. Consider this image enter image description here
Can I mathematically know how many elements exist on level $5$ while respecting the fact that some parent nodes could not have their leaf nodes?