
'''simple docstring'''
lowercase__		    =	{
    "0": 1,
    "1": 1,
    "2": 2,
    "3": 6,
    "4": 2_4,
    "5": 1_2_0,
    "6": 7_2_0,
    "7": 5_0_4_0,
    "8": 4_0_3_2_0,
    "9": 3_6_2_8_8_0,
}

lowercase__		    =	{1_4_5: 1_4_5}

lowercase__		    =	{
    1_4_5: 0,
    1_6_9: 3,
    3_6_3_0_1: 3,
    1_4_5_4: 3,
    8_7_1: 2,
    4_5_3_6_1: 2,
    8_7_2: 2,
}




def 					_UpperCamelCase		(    SCREAMING_SNAKE_CASE__       )   ->				int:


		'''simple docstring'''


		if n in CACHE_SUM_DIGIT_FACTORIALS:
				return CACHE_SUM_DIGIT_FACTORIALS[n]
		snake_case   :    Optional[Any]			       =		sum(DIGIT_FACTORIALS[let] for let in str(SCREAMING_SNAKE_CASE__       )       )
		snake_case   :    int			       =		ret
		return ret




def 					_UpperCamelCase		(    SCREAMING_SNAKE_CASE__      ,    SCREAMING_SNAKE_CASE__ = None       )   ->				int:


		'''simple docstring'''


		snake_case   :    List[Any]			       =		previous or set()
		if n in CHAIN_LENGTH_CACHE:
				return CHAIN_LENGTH_CACHE[n]
		snake_case   :    List[str]			       =		sum_digit_factorials(SCREAMING_SNAKE_CASE__       )
		if next_number in previous:
				snake_case   :    Optional[int]			       =		0
				return 0
		else:
				previous.add(SCREAMING_SNAKE_CASE__       )
				snake_case   :    int			       =		1 + chain_length(SCREAMING_SNAKE_CASE__      ,    SCREAMING_SNAKE_CASE__       )
				snake_case   :    Any			       =		ret
				return ret




def 					_UpperCamelCase		(    SCREAMING_SNAKE_CASE__ = 60      ,    SCREAMING_SNAKE_CASE__ = 100_0000       )   ->				int:


		'''simple docstring'''


		return sum(1 for i in range(1      ,    SCREAMING_SNAKE_CASE__       ) if chain_length(SCREAMING_SNAKE_CASE__       ) == num_terms       )


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




'''simple docstring'''
from __future__ import annotations

from collections.abc import Callable




def 					_UpperCamelCase		(    SCREAMING_SNAKE_CASE__      ,    SCREAMING_SNAKE_CASE__      ,    SCREAMING_SNAKE_CASE__      ,    SCREAMING_SNAKE_CASE__ = 100      ,    )   ->				float:


		'''simple docstring'''


		snake_case   :    int			       =		x_start
		snake_case   :    Tuple			       =		fnc(SCREAMING_SNAKE_CASE__       )
		snake_case   :    Dict			       =		0.0

		for _ in range(SCREAMING_SNAKE_CASE__       ):
				# Approximates small segments of curve as linear and solve
				# for trapezoidal area
				snake_case   :    str			       =		(x_end - x_start) / steps + xa
				snake_case   :    str			       =		fnc(SCREAMING_SNAKE_CASE__       )
				area += abs(fxa + fxa       ) * (xa - xa) / 2

				# Increment step
				snake_case   :    Any			       =		xa
				snake_case   :    List[str]			       =		fxa
		return area


if __name__ == "__main__":




						def 					_UpperCamelCase		(    SCREAMING_SNAKE_CASE__       )   ->				str:


								'''simple docstring'''


								return x**3

						print("f(x) = x^3")
						print("The area between the curve, x = -10, x = 10 and the x axis is:")
						lowercase__		    =	1_0
						while i <= 1_0_0_0_0_0:
												lowercase__		    =	trapezoidal_area(f, -5, 5, i)
												print(f"with {i} steps: {area}")
												i *= 1_0


