code: 
  
  
  """simple docstring"""
  import math
  
  def 							_snake_case			(      __snake_case       :			int      ):
  
  
  
  
     """simple docstring"""
  
  
  
  
  
  
  
     if 1 < number < 4:
        # 2 and 3 are primes
        return True
     elif number < 2 or number % 2 == 0 or number % 3 == 0:
        # Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
        return False
  
     # All primes number are in format of 6k +/- 1
     for i in range(5	,   int(math.sqrt(__snake_case      ) + 1      )	,   6      ):
        if number % i == 0 or number % (i + 2) == 0:
           return False
     return True
  
  def 							_snake_case			(      __snake_case       :			int = 1000	,   __snake_case       :			int = 1000      ):
  
  
  
  
     """simple docstring"""
  
  
  
  
  
  
  
     _lowerCamelCase  :				Optional[int]      =		[0, 0, 0]  # length, a, b
     for a in range((a_limit * -1) + 1	,   __snake_case      ):
        for b in range(2	,   __snake_case      ):
           if is_prime(__snake_case      ):
              _lowerCamelCase  :				Union[str, Any]      =		0
              _lowerCamelCase  :				Union[str, Any]      =		0
              while is_prime((n**2) + (a * n) + b      ):
                 count += 1
                 n += 1
              if count > longest[0]:
                 _lowerCamelCase  :				Optional[int]      =		[count, a, b]
     _lowerCamelCase  :				int      =		longest[1] * longest[2]
     return ans
  
  
  if __name__ == "__main__":
   print(solution(1000, 1000))
  
  
  
  
style_context: 
  
  
  """simple docstring"""
  from itertools import permutations
  
  def 							_snake_case			(      __snake_case       :			int = 5      ):
  
  
  
  
     """simple docstring"""
  
  
  
  
  
  
  
     if gon_side < 3 or gon_side > 5:
        raise ValueError("""gon_side must be in the range [3, 5]"""      )
  
     # Since it's 16, we know 10 is on the outer ring
     # Put the big numbers at the end so that they are never the first number
     _lowerCamelCase  :				Dict      =		list(range(gon_side + 1	,   0	,   -1      )      )
     _lowerCamelCase  :				Optional[int]      =		list(range(gon_side + 2	,   gon_side * 2 + 1      )      )
  
     for perm in permutations(small_numbers + big_numbers      ):
        _lowerCamelCase  :				List[str]      =		generate_gon_ring(__snake_case	,   list(__snake_case      )      )
        if is_magic_gon(__snake_case      ):
           return int("""""".join(str(__snake_case      ) for n in numbers      )      )
  
     _lowerCamelCase  :				Union[str, Any]      =		F'Magic {gon_side}-gon ring is impossible'
     raise ValueError(__snake_case      )
  
  def 							_snake_case			(      __snake_case       :			int	,   __snake_case       :			list[int]      ):
  
  
  
  
     """simple docstring"""
  
  
  
  
  
  
  
     _lowerCamelCase  :				Union[str, Any]      =		[0] * (gon_side * 3)
     _lowerCamelCase  :				Dict      =		perm[0:3]
     perm.append(perm[1]      )
  
     _lowerCamelCase  :				Tuple      =		1 if gon_side < 5 else 2
  
     for i in range(1	,   len(__snake_case      ) // 3 + magic_number      ):
        _lowerCamelCase  :				Dict      =		perm[2 * i + 1]
        _lowerCamelCase  :				str      =		result[3 * i - 1]
        _lowerCamelCase  :				Dict      =		perm[2 * i + 2]
  
     return result
  
  def 							_snake_case			(      __snake_case       :			list[int]      ):
  
  
  
  
     """simple docstring"""
  
  
  
  
  
  
  
     if len(__snake_case      ) % 3 != 0:
        raise ValueError("""a gon ring should have a length that is a multiple of 3"""      )
  
     if min(numbers[::3]      ) != numbers[0]:
        return False
  
     _lowerCamelCase  :				str      =		sum(numbers[:3]      )
  
     return all(sum(numbers[i : i + 3]      ) == total for i in range(3	,   len(__snake_case      )	,   3      )      )
  
  
  if __name__ == "__main__":
   print(solution())
  
  