code: def is_primitive_root(r, p, factors, exponents):
      """Check if r is a primitive root of F(p)."""
      if p != prod(factors, exponents) + 1:
          return False
      for f in factors:
          q, control = divmod(p - 1, f)
          if control != 0:
              return False
          if pow(r, q, p) == 1:
              return False
      return True
  
label_desc: Use image node_id 2 for calling a global function with example usage: is_primitive_root(r, p, factors, exponents) and returns: True, False, False, False