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

A		:   Any         =    {145: 145}

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




def   UpperCamelCase__     (    SCREAMING_SNAKE_CASE_  :  int					)     ->    int:
						if n in CACHE_SUM_DIGIT_FACTORIALS:
												return CACHE_SUM_DIGIT_FACTORIALS[n]
						_lowercase									=				sum(DIGIT_FACTORIALS[let] for let in str(SCREAMING_SNAKE_CASE_					)					)
						_lowercase									=				ret
						return ret




def   UpperCamelCase__     (    SCREAMING_SNAKE_CASE_  :  int		,      SCREAMING_SNAKE_CASE_  :  set | None = None					)     ->    int:
						_lowercase									=				previous or set()
						if n in CHAIN_LENGTH_CACHE:
												return CHAIN_LENGTH_CACHE[n]
						_lowercase									=				sum_digit_factorials(SCREAMING_SNAKE_CASE_					)
						if next_number in previous:
												_lowercase									=				0
												return 0
						else:
												previous.add(SCREAMING_SNAKE_CASE_					)
												_lowercase									=				1 + chain_length(SCREAMING_SNAKE_CASE_		,      SCREAMING_SNAKE_CASE_					)
												_lowercase									=				ret
												return ret




def   UpperCamelCase__     (    SCREAMING_SNAKE_CASE_  :  int = 60		,      SCREAMING_SNAKE_CASE_  :  int = 1_00_00_00					)     ->    int:
						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() = }')

def   UpperCamelCase__     (    SCREAMING_SNAKE_CASE_  :  int					)     ->    int:
						return n * (2 * n - 1)




def   UpperCamelCase__     (    SCREAMING_SNAKE_CASE_  :  int					)     ->    bool:
						_lowercase									=				(1 + 24 * n) ** 0.5
						return ((1 + root) / 6) % 1 == 0




def   UpperCamelCase__     (    SCREAMING_SNAKE_CASE_  :  int = 1_44					)     ->    int:
						_lowercase									=				start
						_lowercase									=				hexagonal_num(SCREAMING_SNAKE_CASE_					)
						while not is_pentagonal(SCREAMING_SNAKE_CASE_					):
												n += 1
												_lowercase									=				hexagonal_num(SCREAMING_SNAKE_CASE_					)
						return num


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