






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

def      _lowerCamelCase	(						__A    :							Optional[int] )      ->					Tuple:
    _UpperCAmelCase				:      List[Any]			  =				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
SCREAMING_SNAKE_CASE 							=	[None] * 10000000
SCREAMING_SNAKE_CASE 							=	True
SCREAMING_SNAKE_CASE 							=	False

def      _lowerCamelCase	(						__A    :							str )      ->					List[Any]:

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

    _UpperCAmelCase				:      Optional[int]			  =				chain(next_number(__A ) )
    _UpperCAmelCase				:      int			  =				number_chain

    while number < 10_000_000:
        _UpperCAmelCase				:      Dict			  =				number_chain
        number *= 10

    return number_chain

def      _lowerCamelCase	(						__A    :							List[str] = 10_000_000 )      ->					Optional[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() = }')












from __future__ import annotations

def      _lowerCamelCase	(						__A    :							int )      ->					list[int]:
    _UpperCAmelCase				:      List[str]			  =				[True] * limit
    _UpperCAmelCase				:      Optional[int]			  =				False
    _UpperCAmelCase				:      Dict			  =				False
    _UpperCAmelCase				:      List[str]			  =				True

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

    _UpperCAmelCase				:      Optional[int]			  =				[2]

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

    return primes

def      _lowerCamelCase	(						__A    :							int = 1_000_000 )      ->					int:
    _UpperCAmelCase				:      Any			  =				prime_sieve(__A )
    _UpperCAmelCase				:      Optional[Any]			  =				0
    _UpperCAmelCase				:      Tuple			  =				0

    for i in range(len(__A ) ):
        for j in range(i + length		,		len(__A ) ):
            _UpperCAmelCase				:      List[Any]			  =				sum(primes[i:j] )
            if sol >= ceiling:
                break

            if sol in primes:
                _UpperCAmelCase				:      List[str]			  =				j - i
                _UpperCAmelCase				:      Optional[Any]			  =				sol

    return largest


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




