



"""simple docstring"""





import math






def 						__UpperCAmelCase       (							snake_case_	:	str )				->						Any:






   """simple docstring"""


   _lowerCAmelCase         =		[True] * n
   _lowerCAmelCase         =		False
   _lowerCAmelCase         =		False
   _lowerCAmelCase         =		True

   for i in range(3 ,						int(n**0.5 + 1 ) ,						2 ):
      _lowerCAmelCase         =		i * 2
      while index < n:
         _lowerCAmelCase         =		False
         _lowerCAmelCase         =		index + i

   _lowerCAmelCase         =		[2]

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

   return primes






def 						__UpperCAmelCase       (							snake_case_	:	List[Any] = 999966663333 )				->						Dict:






   """simple docstring"""


   _lowerCAmelCase         =		math.floor(math.sqrt(__A ) ) + 100
   _lowerCAmelCase         =		prime_sieve(__A )

   _lowerCAmelCase         =		0
   _lowerCAmelCase         =		0
   _lowerCAmelCase         =		primes[prime_index]

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

      _lowerCAmelCase         =		last_prime**2
      _lowerCAmelCase         =		next_prime**2

      # Get numbers divisible by lps(current)
      _lowerCAmelCase         =		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)
      _lowerCAmelCase         =		upper_bound - next_prime
      while current > lower_bound:
         matches_sum += current
         current -= next_prime

      # Remove the numbers divisible by both ups and lps
      _lowerCAmelCase         =		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
      _lowerCAmelCase         =		next_prime
      prime_index += 1

   return matches_sum


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




'''simple docstring'''





from __future__ import annotations




def lowerCAmelCase    (__A):



     """simple docstring"""



     return len(set(__A)) == len(__A)


if __name__ == "__main__":
  import doctest

  doctest.testmod()



