input: Write a python function to detect the maximum consecutive sequence length and its corresponding number in a sequence.
  assert detect_patterns([1, 2, 2, 3, 3, 3, 4, 4, 4, 4]) == (4, 4)
  assert detect_patterns([7, 7, 7, 6, 6, 5, 5, 5, 5, 5]) == (5, 5)
  assert detect_patterns([1, 2, 3, 4, 5, 6]) == (1, 1)
  assert detect_patterns([5, 5, 5, 5, 5, 5, 5]) == (7, 5)
output: def detect_patterns(sequence):
      max_len = 0
      max_num = None
      current_len = 1
  
      for i in range(1, len(sequence)):
          if sequence[i] == sequence[i-1]:
              current_len += 1
          else:
              if current_len > max_len:
                  max_len = current_len
                  max_num = sequence[i-1]
              current_len = 1
  
      if current_len > max_len:
          max_len = current_len
          max_num = sequence[-1]
  
      return (max_len, max_num)