



from math import factorial

lowercase_						=       {str(digit): factorial(digit) for digit in range(10)}



def __lowerCAmelCase	(       SCREAMING_SNAKE_CASE_					):

   if not isinstance(__a  ,					__a					):
      raise TypeError("Parameter number must be int"					)

   if number < 0:
      raise ValueError("Parameter number must be greater than or equal to 0"					)

   # Converts number in string to iterate on its digits and adds its factorial.
   return sum(DIGIT_FACTORIAL[digit] for digit in str(__a					)					)



def __lowerCAmelCase	(       SCREAMING_SNAKE_CASE_ = 60  ,					SCREAMING_SNAKE_CASE_ = 100_0000					):

   if not isinstance(__a  ,					__a					) or not isinstance(__a  ,					__a					):
      raise TypeError("Parameters chain_length and number_limit must be int"					)

   if chain_length <= 0 or number_limit <= 0:
      raise ValueError(
          "Parameters chain_length and number_limit must be greater than 0"					)

   # the counter for the chains with the exact desired length
   lowercase__   					=			0
   # the cached sizes of the previous chains
   lowercase__   					=			{}

   for start_chain_element in range(1  ,					__a					):
      # The temporary set will contain the elements of the chain
      lowercase__   					=			set()
      lowercase__   					=			0

      # Stop computing the chain when you find a cached size, a repeating item or the
      # length is greater then the desired one.
      lowercase__   					=			start_chain_element
      while (
          chain_element not in chain_sets_lengths
          and chain_element not in chain_set
          and chain_set_length <= chain_length
      ):
         chain_set.add(__a					)
         chain_set_length += 1
         lowercase__   					=			digit_factorial_sum(__a					)

      if chain_element in chain_sets_lengths:
         chain_set_length += chain_sets_lengths[chain_element]

      lowercase__   					=			chain_set_length

      # If chain contains the exact amount of elements increase the counter
      if chain_set_length == chain_length:
         chains_counter += 1

   return chains_counter


if __name__ == "__main__":
       import doctest

       doctest.testmod()
       print(F'{solution()}')









def __lowerCAmelCase	(       SCREAMING_SNAKE_CASE_					):
			lowercase__   					=			int(SCREAMING_SNAKE_CASE_					)
			if decimal in (0, 1):  # Exit cases for the recursion
						return str(SCREAMING_SNAKE_CASE_					)
			lowercase__					,    lowercase__   					=			divmod(SCREAMING_SNAKE_CASE_  ,					2					)
			return binary_recursive(SCREAMING_SNAKE_CASE_					) + str(SCREAMING_SNAKE_CASE_					)



def __lowerCAmelCase	(       SCREAMING_SNAKE_CASE_					):
			lowercase__   					=			str(SCREAMING_SNAKE_CASE_					).strip()
			if not number:
						raise ValueError("No input value was provided"					)
			lowercase__   					=			"-" if number.startswith("-"					) else ""
			lowercase__   					=			number.lstrip("-"					)
			if not number.isnumeric():
						raise ValueError("Input value is not an integer"					)
			return f'''{negative}0b{binary_recursive(int(SCREAMING_SNAKE_CASE_					)					)}'''


if __name__ == "__main__":
							from doctest import testmod

							testmod()




