code: def euler_totient(n):
      """Euler's totient function or Phi function.
      Time Complexity: O(sqrt(n))."""
      result = n
      for i in range(2, int(n**0.5) + 1):
          if n % i == 0:
              while n % i == 0:
                  n //= i
              result -= result // i
      if n > 1:
          result -= result // n
      return result
  
file_path: keon-algos/algorithms/maths/diffie_hellman_key_exchange.py
imports: import math
  from random import randint
label_desc: Use image node_id 3 for calling a global function with example usage: euler_totient(n) and returns: result