





'''simple docstring'''






from __future__ import annotations






def   __A    (				a_    :	int						):
		lowerCAmelCase  :     Union[str, Any]       						= [True] * limit
		lowerCAmelCase  :     Tuple       						= False
		lowerCAmelCase  :     List[str]       						= False
		lowerCAmelCase  :     Tuple       						= True

		for i in range(3   ,int(limit**0.5 + 1						)   ,2						):
				lowerCAmelCase  :     List[str]       						= i * 2
				while index < limit:
						lowerCAmelCase  :     Union[str, Any]       						= False
						lowerCAmelCase  :     Optional[int]       						= index + i

		lowerCAmelCase  :     Optional[Any]       						= [2]

		for i in range(3   ,a_   ,2						):
				if is_prime[i]:
						primes.append(a_						)

		return primes






def   __A    (				a_    :	int = 1_0_0_0_0_0_0						):
		lowerCAmelCase  :     Tuple       						= prime_sieve(a_						)
		lowerCAmelCase  :     Tuple       						= 0
		lowerCAmelCase  :     Optional[Any]       						= 0

		for i in range(len(a_						)						):
				for j in range(i + length   ,len(a_						)						):
						lowerCAmelCase  :     List[str]       						= sum(primes[i:j]						)
						if sol >= ceiling:
								break

						if sol in primes:
								lowerCAmelCase  :     int       						= j - i
								lowerCAmelCase  :     int       						= sol

		return largest


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










'''simple docstring'''






lowerCAmelCase									=   [sum(int(c, 10) ** 2 for c in i.__str__()) for i in range(10_00_00)]






def   __A    (				a_    :	int						):
		lowerCAmelCase  :     Optional[int]       						= 0
		while number:
				# Increased Speed Slightly by checking every 5 digits together.
				sum_of_digits_squared += DIGITS_SQUARED[number % 1_0_0_0_0_0]
				number //= 1_0_0_0_0_0

		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
lowerCAmelCase									=   [None] * 10_00_00_00
lowerCAmelCase									=   True
lowerCAmelCase									=   False






def   __A    (				a_    :	int						):

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

		lowerCAmelCase  :     Dict       						= chain(next_number(a_						)						)
		lowerCAmelCase  :     Union[str, Any]       						= number_chain

		while number < 1_0_0_0_0_0_0_0:
				lowerCAmelCase  :     Any       						= number_chain
				number *= 1_0

		return number_chain






def   __A    (				a_    :	int = 1_0_0_0_0_0_0_0						):
		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() = }''')



