
'''simple docstring'''







lowercase					:							List[str]   =      [sum(int(c, 10) ** 2 for c in i.__str__()) for i in range(10_0000)]







def        SCREAMING_SNAKE_CASE__			(     __A			) ->			int:
	_snake_case     		=	0
	while number:
		# Increased Speed Slightly by checking every 5 digits together.
		sum_of_digits_squared += DIGITS_SQUARED[number % 100_000]
		number //= 100_000

	return sum_of_digits_squared


# There are 2 Chains made,
# One ends with 89 with the chain member 58 being the one which when declared first,
# there will be the least number of iterations for all the members to be checked.

# The other one ends with 1 and has only one element 1.

# So 58 and 1 are chosen to be declared at the starting.

# Changed dictionary to an array to quicken the solution
lowercase					:							list[bool | None]   =      [None] * 1000_0000
lowercase					:							Union[str, Any]   =      True
lowercase					:							Optional[int]   =      False







def        SCREAMING_SNAKE_CASE__			(     __A			) ->			bool:

	if CHAINS[number - 1] is not None:
		return CHAINS[number - 1]  # type: ignore

	_snake_case     		=	chain(next_number(__A			)			)
	_snake_case     		=	number_chain

	while number < 10_000_000:
		_snake_case     		=	number_chain
		number *= 10

	return number_chain







def        SCREAMING_SNAKE_CASE__			(     __A = 10_000_000			) ->			int:
	for i in range(1    ,       __A			):
		if CHAINS[i] is None:
			chain(i + 1			)

	return CHAINS[:number].count(__A			)


if __name__ == "__main__":
				import doctest

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



'''simple docstring'''







from typing import Any

import numpy as np







def        SCREAMING_SNAKE_CASE__			(     __A			) ->			bool:
	return np.array_equal(__A    ,       matrix.conjugate().T			)







def        SCREAMING_SNAKE_CASE__			(     __A    ,       __A			) ->			Any:
	_snake_case     		=	v.conjugate().T
	_snake_case     		=	v_star.dot(__A			)
	assert isinstance(__A    ,       np.ndarray			)
	return (v_star_dot.dot(__A			)) / (v_star.dot(__A			))







def        SCREAMING_SNAKE_CASE__			(     ) ->			None:
	_snake_case     		=	np.array([[2, 2 + 1j, 4], [2 - 1j, 3, 1j], [4, -1j, 1]]			)
	_snake_case     		=	np.array([[1], [2], [3]]			)
	assert is_hermitian(__A			), F'{a} is not hermitian.'
	print(rayleigh_quotient(__A    ,       __A			)			)

	_snake_case     		=	np.array([[1, 2, 4], [2, 3, -1], [4, -1, 1]]			)
	assert is_hermitian(__A			), F'{a} is not hermitian.'
	assert rayleigh_quotient(__A    ,       __A			) == float(3			)


if __name__ == "__main__":
					import doctest

					doctest.testmod()
					tests()

