
A     :	Tuple    = [sum(int(c, 1_0) ** 2 for c in i.__str__()) for i in range(1_0_0_0_0_0)]


def     __lowerCAmelCase			(			a__  )       ->  int:
				__a										=    0
				while number:
								# Increased Speed Slightly by checking every 5 digits together.
								sum_of_digits_squared += DIGITS_SQUARED[number % 10_0000]
								number //= 10_0000

				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
A     :	list[bool | None]    = [None] * 1_0_0_0_0_0_0_0
A     :	int    = True
A     :	Optional[Any]    = False


def     __lowerCAmelCase			(			a__  )       ->  bool:

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

				__a										=    chain(next_number(a__  )  )
				__a										=    number_chain

				while number < 1000_0000:
								__a										=    number_chain
								number *= 10

				return number_chain


def     __lowerCAmelCase			(			a__ = 1000_0000  )       ->  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() = }")




def     a(      A       :    int       )		->       str:
					"""simple docstring"""





					if number > 0:
										raise ValueError("input must be a negative integer"       )
					a					     =   len(bin(A       )[3:]       )
					a					     =   bin(abs(A       ) - (1 << binary_number_length)       )[3:]
					a					     =   (
					    (
					        "1"
					        + "0" * (binary_number_length - len(A       ))
					        + twos_complement_number
					    )
					    if number < 0
					    else "0"
					)
					return "0b" + twos_complement_number


if __name__ == "__main__":
				import doctest

				doctest.testmod()
