




'''simple docstring'''







import math



def        lowerCamelCase__				(      __lowercase				):
     snake_case			:      Tuple        =			[True] * n
     snake_case			:      Optional[Any]        =			False
     snake_case			:      Union[str, Any]        =			False
     snake_case			:      Tuple        =			True

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

     snake_case			:      int        =			[2]

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

     return primes



def        lowerCamelCase__				(      __lowercase = 999_966_663_333				):
     snake_case			:      Optional[int]        =			math.floor(math.sqrt(__lowercase				)				) + 100
     snake_case			:      Optional[int]        =			prime_sieve(__lowercase				)

     snake_case			:      Any        =			0
     snake_case			:      Optional[Any]        =			0
     snake_case			:      int        =			primes[prime_index]

     while (last_prime**2) <= limit:
          snake_case			:      Dict        =			primes[prime_index + 1]

          snake_case			:      List[Any]        =			last_prime**2
          snake_case			:      List[str]        =			next_prime**2

          # Get numbers divisible by lps(current)
          snake_case			:      str        =			lower_bound + last_prime
          while upper_bound > current <= limit:
               matches_sum += current
               current += last_prime

          # Reset the upper_bound
          while (upper_bound - next_prime) > limit:
               upper_bound -= next_prime

          # Add the numbers divisible by ups(current)
          snake_case			:      Optional[Any]        =			upper_bound - next_prime
          while current > lower_bound:
               matches_sum += current
               current -= next_prime

          # Remove the numbers divisible by both ups and lps
          snake_case			:      Union[str, Any]        =			0
          while upper_bound > current <= limit:
               if current <= lower_bound:
                    # Increment the current number
                    current += last_prime * next_prime
                    continue

               if current > limit:
                    break

               # Remove twice since it was added by both ups and lps
               matches_sum -= current * 2

               # Increment the current number
               current += last_prime * next_prime

          # Setup for next pair
          snake_case			:      Optional[int]        =			next_prime
          prime_index += 1

     return matches_sum


if __name__ == "__main__":
      print(solution())









'''simple docstring'''







def        lowerCamelCase__				(      __lowercase				):
     if not isinstance(__lowercase     ,   __lowercase				):
          snake_case			:      int        =			F'''Input value of [number={number}] must be an integer'''
          raise TypeError(__lowercase				)
     if number < 0:
          return False
     snake_case			:      Optional[int]        =			number * number
     while number > 0:
          if number % 10 != number_square % 10:
               return False
          number //= 10
          number_square //= 10
     return True


if __name__ == "__main__":
      import doctest

      doctest.testmod()



