"""simple docstring"""


def 			lowerCamelCase_ (					__lowerCAmelCase   ,    __lowerCAmelCase   ,    __lowerCAmelCase				)							->					Union[str, Any]:




						'''simple docstring'''



						if power < 0:
												return -1
						base %= mod
						lowerCamelCase__					=1

						while power > 0:
												if power & 1:
																		lowerCamelCase__					=(result * base) % mod
												lowerCamelCase__					=power >> 1
												lowerCamelCase__					=(base * base) % mod

						return result





def 			lowerCamelCase_ (					)							->					Optional[int]:




						'''simple docstring'''



						print(modular_exponential(3   ,    200   ,    13				)				)


if __name__ == "__main__":
	import doctest

	doctest.testmod()

	main()









"""simple docstring"""


from __future__ import annotations





def 							a__	(     _UpperCAmelCase		,   _UpperCAmelCase		,   _UpperCAmelCase		,   )			->     list[float | int]:

 '''simple docstring'''






 if not all((nth_term, start_term_a, common_ratio_r)		):
  return []
 snake_case__										= []
 snake_case__										= 1
 snake_case__										= common_ratio_r
 for _ in range(int(_UpperCAmelCase		)		):
  if not series:
   series.append(_UpperCAmelCase		)
  else:
   power += 1
   series.append(float(start_term_a * multiple		)		)
   snake_case__										= pow(float(_UpperCAmelCase		)		,   _UpperCAmelCase		)
 return series


if __name__ == "__main__":
   import doctest

   doctest.testmod()

   a__    :   int    						= float(input("""Enter the last number (n term) of the Geometric Series"""))
   a__    :   str    						= float(input("""Enter the starting term (a) of the Geometric Series"""))
   a__    :   str    						= float(
       input("""Enter the common ratio between two terms (r) of the Geometric Series""")
   )
   print("""Formula of Geometric Series => a + ar + ar^2 ... +ar^n""")
   print(geometric_series(nth_term, start_term_a, common_ratio_r))

