code: def is_mersenne_prime(n):
      """Returns True if  ``n`` is a Mersenne prime, else False.
  
      A Mersenne prime is a prime number having the form `2^i - 1`.
  
      Examples
      ========
  
      >>> from sympy.ntheory.factor_ import is_mersenne_prime
      >>> is_mersenne_prime(6)
      False
      >>> is_mersenne_prime(127)
      True
  
      References
      ==========
  
      .. [1] https://mathworld.wolfram.com/MersennePrime.html
  
      """
      n = as_int(n)
      if n < 1:
          return False
      if n & (n + 1):
          # n is not Mersenne number
          return False
      p = n.bit_length()
      if p in MERSENNE_PRIME_EXPONENTS:
          return True
      if p < 65_000_000 or not isprime(p):
          # According to GIMPS, verification was completed on September 19, 2023 for p less than 65 million.
          # https://www.mersenne.org/report_milestones/
          # If p is composite number, then n=2**p-1 is composite number.
          return False
      result = _lucas_lehmer_primality_test(p)
      if result:
          raise ValueError(
              filldedent(
                  """
              This Mersenne Prime, 2^%s - 1, should
              be added to SymPy's known values."""
                  % p
              )
          )
      return result
  
imports: from itertools import count
  from sympy.core.sympify import sympify
  from sympy.external.gmpy import gmpy, gcd, jacobi, is_square, bit_scan1, is_fermat_prp, is_euler_prp, is_selfridge_prp, is_strong_selfridge_prp, is_strong_bpsw_prp
  from sympy.external.ntheory import _lucas_sequence
  from sympy.utilities.misc import as_int, filldedent
label_desc: Use image node_id 13 for calling a global function with example usage: is_mersenne_prime(n) and returns: result, False, False, True, False