For this question, the formula is:
f(n) = f(n - 1) + f(n - 3), for all n >= 3
f(n) = 1, for n <= 2
for n = 1 and n = 2, we only have 1 way that is all ones.
for n > 2, we can use 3 as well as 1, so number of ways is a
combination of 1's and 3's.
The above recursion gives the result.
Hope this helps. Please rate the answer if you like it.
A person communicates over a channel in Morse Code, which consists of dashes and dots. It...