Hi, I have a triangle starting from $0$ and going up by one on the bottom row until there are $r$ items on the bottom row and there are $r$ rows a number is formed by adding the two numbers towards the fat end of the triangle together.
Example: $$x \downarrow\ $$ $$ \begin{matrix}12\end{matrix}\\ \begin{matrix}4 & 8\end{matrix}\\ \begin{matrix}1 & 3 & 5\end{matrix}\\ \begin{matrix}0 & 1 & 2 & \boxed{3}\end{matrix} $$ $$\begin{matrix}& & r - 1 \uparrow\end{matrix}$$ $\therefore$ when $r = 4$, $x = 12$.
When $r = 8$ $$ \begin{matrix}0\ \ & 1\ \ & 2\ \ & 3\ \ & 4\ \ & 5\ \ & 6\ \ & 7\ \ \end{matrix}\\ \begin{matrix}1\ \ & 3\ \ & 5\ \ & 7\ \ & 9\ \ & 11\ & 13\ \end{matrix}\\ \begin{matrix}4\ \ & 8\ \ & 12\ & 16\ & 20\ & 24\ \end{matrix}\\ \begin{matrix}12\ & 20\ & 28\ & 36\ & 44\ \end{matrix}\\ \begin{matrix}32\ & 48\ & 64\ & 80\ \end{matrix}\\ \begin{matrix}80\ & 112 & 144 \end{matrix}\\ \begin{matrix}192 & 256 \end{matrix}\\ \begin{matrix}448\end{matrix}\\ $$ $\therefore x = 448$
How do I work out $x$ from $r$? What is the formula? Any help by suggesting a new viewpoint or formula(e) would be greatly appreciated. Thank you.
A recursive solution: number the rows $0$ to $r-1$ with $0$ being the fattest, notice that the difference between consecutive numbers in row $k$ is $2^k$.
Denote by $f(n)$ the number in the last row of a triangle with $n$ rows. Then $f(n)=2f(n-1)+2^{n-2}$
Notice $f(1)=0,f(2)=1,f(3)=4$
From this recurrence we pass to $f(n)=(n-1)2^{n-2}$
The proof is by induction. Suppose $f(n)=(n-1)2^{n-2}$
then $f(n+1)=(n-1)2^{n-1}+2^{n-1}=n(2^{n-1})$ as desired.