On 2d
Question: What is the maximum number of regions that can be formed with n lines?
The main idea: A line can cut another line in at most 1 point.
As we want to form maximum number of regions, we are not going to allow any parallel lines.
Let $L_n$ = maximum number of regions that can be formed with $n$ lines
Clearly,
$L_0 = 1$, as there is no line
$L_1 = 2$, one line cuts the region into two half
$L_2 = 4$, cut the previous line with the new line
$L_3 = 7$, we can cut each two previous lines in two different points to achieve maximum number of regions
This indeed provides maximum number of regions, because while cutting a line and forming a point we are going to other regions to cut those regions into half. If we don't cut a line, we won't be visiting new regions to cut those. That means we need to form as many points on the 2-D space as possible while cutting the regions.
So while drawing $nth$ line on the region, we can form $(n - 1)$ points by cutting each of the $(n - 1)$ previously drawn lines. It turns out while forming $p$ points we are making $p + 1$ new regions. That means the $nth$ line will make $n + 1$ new regions.
Therefore the recurrence would be
$$
L_n =
\begin{cases}
1, & \text{if $n = 0$} \\
L_{n - 1} + n, & \text{if $n > 0$}
\end{cases}
$$
The solution for the above recurrence is
$$ L_n = 1 + S_n, \text{where $n \ge 0$}$$
where $S_n$ = triangular number
$$S_n = \frac{n(n+1)}{2}$$
Now let's go to 3D
On 3d
Question: What is the maximum number of regions that can be formed with n planes?
The main idea: A plane can cut another plane in at most 1 line.
Let $P_n$ = maximum number of regions that can be formed with n planes
Clearly,
$P_0 = 1$, as there is no plane
$P_1 = 2$, as the single plane cuts the whole region into half
$P_2 = 4$, cut the previous plane with the new plane thereby forming a new line
$P_3 = 8$, We can cut the two previous planes in two different new lines so we are forming two new lines this time which will add $L_2$ regions at maximum
In a similar argument, the $nth$ plane will cut each $n - 1$ planes in $n - 1$ lines at max. So it will create $n - 1$ new lines. But we already know the $n - 1$ new lines will add at max $L_{n - 1}$ regions.
Therefore the recurrence would be
$$
P_n =
\begin{cases}
1, & \text{if $n = 0$} \\
P_{n - 1} + L_{n - 1}, & \text{if $n > 0$}
\end{cases}
$$
The solution for the above recurrence is
$$P_n = \frac{n^3+5n+6}{6}, \text{where $n \ge 0$}$$
If you are curious enough, on 4d
if $SP_n$ = maximum number of regions that can be formed with n spaces
then
$$
SP_n =
\begin{cases}
1, & \text{if $n = 0$} \\
SP_{n - 1} + P_{n - 1}, & \text{if $n > 0$}
\end{cases}
$$
The solution for the above recurrence is
$$SP_n = \frac{n^4 - 2n^3 + 11n^2 + 14n + 24}{24}, \text{where $n \ge 0$}$$