Consider a given sequence of length $k$. I want to calculate the number of sequences of length $n$ that contains the given sequence as a subsequence. The alphabet used to generate the string consists of $|A|$ values.
For example, a sequence "120" is given. in this case, k=3. Consider the alphabet to be $A=\{0,1,2,3\}$ and $n=5$. In this case, two of the possible sequences are:
10230
12320
And the question becomes the total number of sequences of length 5 which contain "120" as a subsequence. The important part here is that the given subsequence is not necessarily contained in the sequence, which is clear by the provided examples.
I know this problem can be solved by using the principle of inclusion-exclusion. However, I was looking for a more straightforward and probably a closed-form equation for this problem.
Thank you in advance for your help.