


import doctest
from collections import deque

import numpy as np






class      UpperCamelCase					:


   '''simple docstring'''







   def __init__(     self		):
        lowercase_       :Any     =       [2, 1, 2, -1]
        lowercase_       :Optional[Any]     =       [1, 2, 3, 4]




   def 		UpperCamelCase  (     self		):
        lowercase_       :List[str]     =       len(self.first_signal		)
        lowercase_       :str     =       len(self.second_signal		)

        lowercase_       :int     =       max(UpperCamelCase_   ,							UpperCamelCase_		)

        # create a zero matrix of max_length x max_length
        lowercase_       :Any     =       [[0] * max_length for i in range(UpperCamelCase_		)]

        # fills the smaller signal with zeros to make both signals of same length
        if length_first_signal < length_second_signal:
             self.first_signal += [0] * (max_length - length_first_signal)
        elif length_first_signal > length_second_signal:
             self.second_signal += [0] * (max_length - length_second_signal)
        for i in range(UpperCamelCase_		):
             lowercase_       :List[str]     =       deque(self.second_signal		)
             rotated_signal.rotate(UpperCamelCase_		)
             for j, item in enumerate(UpperCamelCase_		):
                  matrix[i][j] += item

        # multiply the matrix with the first signal
        lowercase_       :Tuple     =       np.matmul(np.transpose(UpperCamelCase_		)   ,							np.transpose(self.first_signal		)		)

        # rounding-off to two decimal places
        return [round(UpperCamelCase_   ,							2		) for i in final_signal]


if __name__ == "__main__":
   doctest.testmod()





def     UpperCamelCase    (      _a		)					->							int:
     '''simple docstring'''





     assert isinstance(_a       ,		_a		), f"The input value of [n={number}] is not an integer"

     if number == 1:
          return 2
     elif number < 1:
          lowercase_       :str     =       f"The input value of [n={number}] has to be > 0"
          raise ValueError(_a		)
     else:
          lowercase_       :List[str]     =       sylvester(number - 1		)
          lowercase_       :Union[str, Any]     =       num - 1
          lowercase_       :List[str]     =       num
          return lower * upper + 1


if __name__ == "__main__":
   print(f"The 8th number in Sylvester's sequence: {sylvester(8)}")

