




'''simple docstring'''





def 					a__    (				UpperCamelCase_	:			list	):
   if not isinstance(UpperCamelCase_,      UpperCamelCase_	):
      raise ValueError('''Input series is not valid, valid series - [1, 2/3, 2]'''	)
   if len(UpperCamelCase_	) == 0:
      raise ValueError('''Input list must be a non empty list'''	)
   if len(UpperCamelCase_	) == 1 and series[0] != 0:
      return True
   UpperCAmelCase__  :Any            =			[]
   UpperCAmelCase__  :int            =			len(UpperCamelCase_	)
   for i in range(0,      UpperCamelCase_	):
      if series[i] == 0:
         raise ValueError('''Input series cannot have 0 as an element'''	)
      rec_series.append(1 / series[i]	)
   UpperCAmelCase__  :List[Any]            =			rec_series[1] - rec_series[0]
   for index in range(2,      UpperCamelCase_	):
      if rec_series[index] - rec_series[index - 1] != common_diff:
         return False
   return True


def 					a__    (				UpperCamelCase_	:			list	):
   if not isinstance(UpperCamelCase_,      UpperCamelCase_	):
      raise ValueError('''Input series is not valid, valid series - [2, 4, 6]'''	)
   if len(UpperCamelCase_	) == 0:
      raise ValueError('''Input list must be a non empty list'''	)
   UpperCAmelCase__  :Optional[int]            =			0
   for val in series:
      answer += 1 / val
   return len(UpperCamelCase_	) / answer


if __name__ == "__main__":
    import doctest

    doctest.testmod()







'''simple docstring'''





def 					a__    (				UpperCamelCase_	:			int	):
   UpperCAmelCase__  :str            =			[True for i in range(n + 1	)]
   UpperCAmelCase__  :List[str]            =			[i - 1 for i in range(n + 1	)]
   UpperCAmelCase__  :str            =			[]
   for i in range(2,      n + 1	):
      if is_prime[i]:
         primes.append(UpperCamelCase_	)
      for j in range(0,      len(UpperCamelCase_	)	):
         if i * primes[j] >= n:
            break
         UpperCAmelCase__  :List[str]            =			False

         if i % primes[j] == 0:
            UpperCAmelCase__  :Any            =			totients[i] * primes[j]
            break

         UpperCAmelCase__  :str            =			totients[i] * (primes[j] - 1)

   return totients


if __name__ == "__main__":
    import doctest

    doctest.testmod()



