Consider these three questions:
1- Find the number of sequences of length 𝐿 made of numbers from 1 to 𝑛, such that number 1 appeared at least one time in each substring of length 𝑛.
2- Find the number of sequences of length 𝐿 made of numbers from 1 to 𝑛, such that number 1 appeared at least one time in each substring of length 𝑘.
3- Find the number of sequences of length 𝐿 made of numbers from 1 to 𝑛, such that each number from [1,n] appeared at least one time in each substring of length 𝑘. For example, if 𝑛==𝑘 and 𝐿>=𝑛, the answer will be 𝑘!.
For each of these questions, I want a polynomial time solution( not exponential) that computes it. Moreover, I want to have a good estimation of the answer of each of them based on the input variables.