


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





def 	_lowerCAmelCase					( UpperCamelCase__:  int    )			-> int:





	"""simple docstring"""







	A             =					0
	while number:
		# Increased Speed Slightly by checking every 5 digits together.
		sum_of_digits_squared += DIGITS_SQUARED[number % 10_00_00]
		number //= 10_00_00

	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							:   Optional[int]						=						True
_lowercase							:   str						=						False





def 	_lowerCAmelCase					( UpperCamelCase__:  int    )			-> bool:





	"""simple docstring"""







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

	A             =					chain(next_number(UpperCamelCase__    )    )
	A             =					number_chain

	while number < 10_00_00_00:
		A             =					number_chain
		number *= 10

	return number_chain





def 	_lowerCAmelCase					( UpperCamelCase__:  int = 10_00_00_00    )			-> int:





	"""simple docstring"""







	for i in range(1				,       UpperCamelCase__    ):
		if CHAINS[i] is None:
			chain(i + 1    )

	return CHAINS[:number].count(UpperCamelCase__    )


if __name__ == "__main__":
				import doctest

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







from ....configuration_utils import PretrainedConfig
from ....utils import logging


_lowercase							:   List[Any]						=						logging.get_logger(__name__)

_lowercase							:   List[str]						=						{
    "speechbrain/m-ctc-t-large": "https://huggingface.co/speechbrain/m-ctc-t-large/resolve/main/config.json",
    # See all M-CTC-T models at https://huggingface.co/models?filter=mctct
}






class    _UpperCamelCase     (       __snake_case					):

				"""simple docstring"""







				lowerCAmelCase					=			'mctct'

				def __init__(    self					, a__=8065					, a__=1536					, a__=36					, a__=6144					, a__=4					, a__=384					, a__=920					, a__=1e-5					, a__=0.3					, a__="relu"					, a__=0.02					, a__=0.3					, a__=0.3					, a__=1					, a__=0					, a__=2					, a__=1					, a__=0.3					, a__=1					, a__=(7,)					, a__=(3,)					, a__=80					, a__=1					, a__=None					, a__="sum"					, a__=False					, **a__					, )						->					Optional[Any]:
					super().__init__(**a__					, pad_token_id=a__					, bos_token_id=a__					, eos_token_id=a__ )
					A             =					vocab_size
					A             =					hidden_size
					A             =					num_hidden_layers
					A             =					intermediate_size
					A             =					num_attention_heads
					A             =					attention_head_dim
					A             =					max_position_embeddings
					A             =					layer_norm_eps
					A             =					layerdrop
					A             =					hidden_act
					A             =					initializer_range
					A             =					hidden_dropout_prob
					A             =					attention_probs_dropout_prob
					A             =					pad_token_id
					A             =					bos_token_id
					A             =					eos_token_id
					A             =					conv_glu_dim
					A             =					conv_dropout
					A             =					num_conv_layers
					A             =					input_feat_per_channel
					A             =					input_channels
					A             =					conv_channels
					A             =					ctc_loss_reduction
					A             =					ctc_zero_infinity

					# prevents config testing fail with exporting to json
					A             =					list(a__ )
					A             =					list(a__ )

					if len(self.conv_kernel ) != self.num_conv_layers:
						raise ValueError(
						    """Configuration for convolutional module is incorrect. """
						    """It is required that `len(config.conv_kernel)` == `config.num_conv_layers` """
						    f'but is `len(config.conv_kernel) = {len(self.conv_kernel )}`, '
						    f'`config.num_conv_layers = {self.num_conv_layers}`.' )



