


'''simple docstring'''

lowerCamelCase							:       Union[str, Any]  						=     {
    '0': 1,
    '1': 1,
    '2': 2,
    '3': 6,
    '4': 24,
    '5': 120,
    '6': 720,
    '7': 5_040,
    '8': 40_320,
    '9': 362_880,
}

lowerCamelCase							:       Dict  						=     {145: 145}

lowerCamelCase							:       str  						=     {
    145: 0,
    169: 3,
    36_301: 3,
    1_454: 3,
    871: 2,
    45_361: 2,
    872: 2,
}

def _SCREAMING_SNAKE_CASE				(A	)	->	int:






       """simple docstring"""







       if n in CACHE_SUM_DIGIT_FACTORIALS:
              return CACHE_SUM_DIGIT_FACTORIALS[n]
       lowercase__				      =			sum(DIGIT_FACTORIALS[let] for let in str(A	)	)
       lowercase__				      =			ret
       return ret

def _SCREAMING_SNAKE_CASE				(A  ,			A = None	)	->	int:






       """simple docstring"""







       lowercase__				      =			previous or set()
       if n in CHAIN_LENGTH_CACHE:
              return CHAIN_LENGTH_CACHE[n]
       lowercase__				      =			sum_digit_factorials(A	)
       if next_number in previous:
              lowercase__				      =			0
              return 0
       else:
              previous.add(A	)
              lowercase__				      =			1 + chain_length(A  ,			A	)
              lowercase__				      =			ret
              return ret

def _SCREAMING_SNAKE_CASE				(A = 60  ,			A = 1_000_000	)	->	int:






       """simple docstring"""







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


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








'''simple docstring'''

def _SCREAMING_SNAKE_CASE				(A	)	->	list:






       """simple docstring"""







       lowercase__				      =			len(A	)

       # Set the gap value to be decreased by a factor of 1.3
       # after each iteration
       lowercase__				      =			1.3

       # Continue sorting until the gap is 1
       while gap > 1:
              # Decrease the gap value
              lowercase__				      =			int(gap / shrink	)

              # Sort the elements using insertion sort
              for i in range(A  ,			len(A	)	):
                     lowercase__				      =			collection[i]
                     lowercase__				      =			i
                     while j >= gap and collection[j - gap] > temp:
                            lowercase__				      =			collection[j - gap]
                            j -= gap
                     lowercase__				      =			temp

       return collection


if __name__ == "__main__":
 import doctest

 doctest.testmod()




