There's a frog who could climb either 1 stair or 3 stairs in one shot. In how many ways he could reach at 100th stair?
I came up with the solution $g(n) = g(n-3) + g(n-1)$, where $g(0)=g(1)=g(2)=1$ and $g(3)=2$. But to solve $g(100)$ is quite difficult if I use substitution method so I just want to know if there is a feasible method to solve for $g(100)$ ?
This is OEIS A000930, sometimes known as Narayana’s cows sequence. The link does give a closed form:
$$g(n)=\left\lfloor dc^n+\frac12\right\rfloor\;,$$
where $c$ is the real root of $x^3-x^2-1$, and $d$ is the real root of $31x^3-31x^2+9x-1$. It also says that $d=0.611491991950812\dots$ and
$$c=\frac23\cos\left(\frac13\arccos\left(\frac{29}2\right)\right)+\frac13=1.46557123187676\dots\;,$$
but you’ll need moderately high-precision arithmetic to get an exact value for $g(100)$ from that.