(a) Find a recurrence relation for the number of sequences of $ \ 1s, \ 3s, \ and \ \ 5s \ $
whose terms sum to $ \ n $
(b) Repeat part $ \ (a) $ with the added condition that no $ \ 5 \ $ can be followed by a $ \ 1 \ $
(c) Repeat part $ \ (a) \ $ with the condition of no subsequence of $ \ 135 \ $
Answer:
(a)
Let $ \ \{a_n\} $ be the sequences.
The number of sequences of $ \ 1s, \ 3s , \ 5s \ $ is
$ 2^n+2^n+2^n \\ =3 \cdot 2^n \ $
Now given that the sum of the terms $ \ =n \ $ , we have
$ a_{n-1}+a_{n-3}+a_{n-5}=3 \cdot 2^n-n \ $.
This is the recurrence relation.
Am I right ? Is there any help ? Also for the next parts .