code: def is_lucas_prp(n, p, q):
      d = p**2 - 4 * q
      if d == 0:
          raise ValueError("invalid values for p,q in is_lucas_prp()")
      if n < 1:
          raise ValueError(
              "is_lucas_prp() requires 'n' be greater than 0"
          )
      if n == 1:
          return False
      if n % 2 == 0:
          return n == 2
      if gcd(n, q * d) not in [1, n]:
          raise ValueError("is_lucas_prp() requires gcd(n,2*q*D) == 1")
      return _lucas_sequence(n, p, q, n - jacobi(d, n))[0] == 0
  
imports: import sys
  import math
  import mpmath.libmp
label_desc: Use image node_id 21 for calling a global function with example usage: is_lucas_prp(n, p, q) and returns: unknown, False, unknown