


'''simple docstring'''





from __future__ import annotations

import math
from collections.abc import Callable






def 						UpperCAmelCase__(				_SCREAMING_SNAKE_CASE					: Callable[[int | float], int | float],_SCREAMING_SNAKE_CASE					: int | float,_SCREAMING_SNAKE_CASE					: int | float,_SCREAMING_SNAKE_CASE					: int = 100,):






			"""simple docstring"""




			__A=	x_start
			__A=	fnc(_SCREAMING_SNAKE_CASE )
			__A=	0.0

			for _ in range(_SCREAMING_SNAKE_CASE ):
						# Approximates curve as a sequence of linear lines and sums their length
						__A=	(x_end - x_start) / steps + xa
						__A=	fnc(_SCREAMING_SNAKE_CASE )
						length += math.hypot(xa - xa,fxa - fxa )

						# Increment step
						__A=	xa
						__A=	fxa

			return length


if __name__ == "__main__":






					def 						UpperCAmelCase__(				_SCREAMING_SNAKE_CASE					: Union[str, Any] ):






								"""simple docstring"""




								return math.sin(10 * x )

					print('''f(x) = sin(10 * x)''')
					print('''The length of the curve from x = -10 to x = 10 is:''')
					UpperCAmelCase__  			=				1_0
					while i <= 1_0_0_0_0_0:
										print(F"""With {i} steps: {line_length(f, -1_0, 1_0, i)}""")
										i *= 1_0







'''simple docstring'''





import math






def 						UpperCAmelCase__(				_SCREAMING_SNAKE_CASE					: int ):






			"""simple docstring"""




			if not isinstance(_SCREAMING_SNAKE_CASE,_SCREAMING_SNAKE_CASE ):
						__A=	f"""Input value of [number={number}] must be an integer"""
						raise TypeError(_SCREAMING_SNAKE_CASE )

			if number < 1:
						__A=	f"""Input value of [number={number}] must be > 0"""
						raise ValueError(_SCREAMING_SNAKE_CASE )
			elif number == 1:
						return 3
			elif number == 2:
						return 5
			else:
						__A=	int(math.log(number // 3,2 ) ) + 2

						__A=	[3, 5]
						__A=	2
						__A=	3
						for block in range(1,_SCREAMING_SNAKE_CASE ):
									for _ in range(_SCREAMING_SNAKE_CASE ):
												proth_list.append(2 ** (block + 1) + proth_list[proth_index - 1] )
												proth_index += 1
									increment *= 2

			return proth_list[number - 1]


if __name__ == "__main__":
					import doctest

					doctest.testmod()

					for number in range(1_1):
										UpperCAmelCase__  			=				0
										try:
															UpperCAmelCase__  			=				proth(number)
										except ValueError:
															print(F"""ValueError: there is no {number}th Proth number""")
															continue

										print(F"""The {number}th Proth number: {value}""")



