


from decimal import Decimal, getcontext
from math import ceil, factorial






def 							__lowercase     (				__lowerCAmelCase							:       int     ):

       if not isinstance(__lowerCAmelCase      ,					__lowerCAmelCase     ):
              raise TypeError('Undefined for non-integers'     )
       elif precision < 1:
              raise ValueError('Undefined for non-natural numbers'     )

       a__    =  precision
       a__    =  ceil(precision / 1_4     )
       a__    =  4_2_6_8_8_0 * Decimal(1_0_0_0_5     ).sqrt()
       a__    =  1
       a__    =  1_3_5_9_1_4_0_9
       a__    =  Decimal(__lowerCAmelCase     )
       for k in range(1      ,					__lowerCAmelCase     ):
              a__    =  factorial(6 * k     ) // (factorial(3 * k     ) * factorial(__lowerCAmelCase     ) ** 3)
              linear_term += 5_4_5_1_4_0_1_3_4
              exponential_term *= -2_6_2_5_3_7_4_1_2_6_4_0_7_6_8_0_0_0
              partial_sum += Decimal(multinomial_term * linear_term     ) / exponential_term
       return str(constant_term / partial_sum     )[:-1]


if __name__ == "__main__":
      snake_case							: Tuple      =   50
      print(f"""The first {n} digits of pi is: {pi(n)}""")








from math import sqrt






def 							__lowercase     (				__lowerCAmelCase							:       int     ):

							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(sqrt(__lowerCAmelCase     ) + 1     )      ,					6     ):
														if number % i == 0 or number % (i + 2) == 0:
																					return False
							return True






def 							__lowercase     (				__lowerCAmelCase							:       int = 1_0_0_0_1     ):
							a__    =  0
							a__    =  1
							while count != nth and number < 3:
														number += 1
														if is_prime(__lowerCAmelCase     ):
																					count += 1
							while count != nth:
														number += 2
														if is_prime(__lowerCAmelCase     ):
																					count += 1
							return number


if __name__ == "__main__":
						print(f"""{solution() = }""")




