





'''simple docstring'''




def 	__lowerCamelCase			(      __lowerCAmelCase       :							float      ,    __lowerCAmelCase       :							float      ,    __lowerCAmelCase       :							int		)		->  float:
   if principal <= 0:
      raise Exception("""Principal borrowed must be > 0"""		)
   if rate_per_annum < 0:
      raise Exception("""Rate of interest must be >= 0"""		)
   if years_to_repay <= 0 or not isinstance(__lowerCAmelCase      ,    __lowerCAmelCase		):
      raise Exception("""Years to repay must be an integer > 0"""		)

   # Yearly rate is divided by 12 to get monthly rate
   snake_case 						=   rate_per_annum / 12

   # Years to repay is multiplied by 12 to get number of payments as payment is monthly
   snake_case 						=   years_to_repay * 12

   return (
       principal
       * rate_per_month
       * (1 + rate_per_month) ** number_of_payments
       / ((1 + rate_per_month) ** number_of_payments - 1)
   )


if __name__ == "__main__":
 import doctest

 doctest.testmod()








'''simple docstring'''




def 	__lowerCamelCase			(      __lowerCAmelCase       :							int		)		->  int:
   assert isinstance(__lowerCAmelCase      ,    __lowerCAmelCase		), F'''The input value of [n={number}] is not an integer'''

   if number == 1:
      return 2
   elif number < 1:
      snake_case 						=   F'''The input value of [n={number}] has to be > 0'''
      raise ValueError(__lowerCAmelCase		)
   else:
      snake_case 						=   sylvester(number - 1		)
      snake_case 						=   num - 1
      snake_case 						=   num
      return lower * upper + 1


if __name__ == "__main__":
 print(F"""The 8th number in Sylvester's sequence: {sylvester(8)}""")

