"""simple docstring"""





import math





def        a_  (   _lowerCAmelCase						:				int  ):





       '''simple docstring'''

       lowercase__    :	Tuple     					=			[True] * n
       lowercase__    :	Optional[Any]     					=			False
       lowercase__    :	Dict     					=			False
       lowercase__    :	Dict     					=			True

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

       lowercase__    :	Optional[Any]     					=			[2]

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

       return primes





def        a_  (   _lowerCAmelCase						:				int = 9999_6666_3333  ):





       '''simple docstring'''

       lowercase__    :	Any     					=			math.floor(math.sqrt(_lowerCAmelCase  )  ) + 100
       lowercase__    :	Dict     					=			prime_sieve(_lowerCAmelCase  )

       lowercase__    :	str     					=			0
       lowercase__    :	Tuple     					=			0
       lowercase__    :	Any     					=			primes[prime_index]

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

              lowercase__    :	str     					=			last_prime**2
              lowercase__    :	Dict     					=			next_prime**2

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

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

       return matches_sum


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


"""simple docstring"""





import unittest

from transformers import is_torch_available, is_vision_available
from transformers.testing_utils import require_torch, require_vision, slow, torch_device


if is_torch_available():
       import torch

       from transformers import AutoModelForImageClassification

if is_vision_available():
       from transformers import AutoImageProcessor


@require_torch
@require_vision
class   UpperCAmelCase_			(					unittest.TestCase):


      @slow
      def 	_UpperCAmelCase (     self							) ->      str:
             lowercase__    :	Optional[Any]     					=			AutoImageProcessor.from_pretrained('microsoft/dit-base-finetuned-rvlcdip'							)
             lowercase__    :	Union[str, Any]     					=			AutoModelForImageClassification.from_pretrained('microsoft/dit-base-finetuned-rvlcdip'							)
             model.to(a							)

             from datasets import load_dataset

             lowercase__    :	str     					=			load_dataset('nielsr/rvlcdip-demo'							)

             lowercase__    :	Tuple     					=			dataset['train'][0]['image'].convert('RGB'							)

             lowercase__    :	int     					=			image_processor(a	,    return_tensors='pt'							).to(a							)

             # forward pass
             with torch.no_grad():
                    lowercase__    :	List[str]     					=			model(**a							)
                    lowercase__    :	List[Any]     					=			outputs.logits

             lowercase__    :	Union[str, Any]     					=			torch.Size((1, 1_6)							)
             self.assertEqual(logits.shape	,    a							)

             lowercase__    :	Tuple     					=			torch.tensor(
                 [-0.4_158, -0.4_092, -0.4_347]	,    device=a	,    dtype=torch.float	,    )
             self.assertTrue(torch.allclose(logits[0, :3]	,    a	,    atol=1e-4							)							)

