Toufik Mansour: Restricted k-ary Words

This program finds the number of k-ary word of length at most n that avoid a list of patterns L.
  1. Input. k: the size of the alphabet of the words. n: the maximum length. p: the number of the patterns in the list L. L: the list of the patterns
  2. The program assumes that n,k≤20 and the length of each pattern in the list L is at least 3 and at most 7.
  3. Output. Table contains the number of k-ary words of length j that avoid each pattern in L, for j=1,2,…,n, the starting date and time of the calculations and ending date and time of the calculations.