





"""simple docstring"""





from manim import *






class 					_lowerCAmelCase   (     UpperCAmelCase__       ):
       """simple docstring"""




       def      snake_case						(    self      ):



         '''simple docstring'''

         lowerCAmelCase__			:Tuple											=							Rectangle(height=0.5    , width=0.5      )
         lowerCAmelCase__			:Any											=							Rectangle(height=0.46    , width=0.46      ).set_stroke(width=0      )

         lowerCAmelCase__			:List[Any]											=							[mem.copy() for i in range(6      )]
         lowerCAmelCase__			:int											=							[mem.copy() for i in range(6      )]
         lowerCAmelCase__			:Dict											=							VGroup(*__lowercase      ).arrange(__lowercase    , buff=0      )
         lowerCAmelCase__			:Union[str, Any]											=							VGroup(*__lowercase      ).arrange(__lowercase    , buff=0      )
         lowerCAmelCase__			:str											=							VGroup(__lowercase    , __lowercase      ).arrange(__lowercase    , buff=0      )
         lowerCAmelCase__			:Tuple											=							Text('CPU'    , font_size=2_4      )
         lowerCAmelCase__			:List[str]											=							Group(__lowercase    , __lowercase      ).arrange(__lowercase    , buff=0.5    , aligned_edge=__lowercase      )
         cpu.move_to([-2.5, -0.5, 0]      )
         self.add(__lowercase      )

         lowerCAmelCase__			:List[Any]											=							[mem.copy() for i in range(1      )]
         lowerCAmelCase__			:List[Any]											=							VGroup(*__lowercase      ).arrange(__lowercase    , buff=0      )
         lowerCAmelCase__			:Union[str, Any]											=							Text('GPU'    , font_size=2_4      )
         lowerCAmelCase__			:Optional[int]											=							Group(__lowercase    , __lowercase      ).arrange(__lowercase    , buff=0.5    , aligned_edge=__lowercase      )
         gpu.align_to(__lowercase    , __lowercase      )
         gpu.set_x(gpu.get_x() - 1      )

         self.add(__lowercase      )

         lowerCAmelCase__			:Optional[Any]											=							[mem.copy() for i in range(6      )]
         lowerCAmelCase__			:str											=							VGroup(*__lowercase      ).arrange(__lowercase    , buff=0      )

         lowerCAmelCase__			:List[str]											=							Text('Model'    , font_size=2_4      )
         lowerCAmelCase__			:Union[str, Any]											=							Group(__lowercase    , __lowercase      ).arrange(__lowercase    , buff=0.5    , aligned_edge=__lowercase      )
         model.move_to([3, -1.0, 0]      )

         self.play(
             Create(__lowercase    , run_time=1      )    , Create(__lowercase    , run_time=1      )    , Create(__lowercase    , run_time=1      )    , )

         lowerCAmelCase__			:Optional[int]											=							MarkupText(
             F"First, an empty model skeleton is loaded\ninto <span fgcolor='{YELLOW}'>memory</span> without using much RAM."    , font_size=2_4    , )

         lowerCAmelCase__			:List[str]											=							Square(side_length=2.2      )
         key.move_to([-5, 2, 0]      )

         lowerCAmelCase__			:int											=							MarkupText(
             F"<b>Key:</b>\n\n<span fgcolor='{YELLOW}'>●</span> Empty Model"    , font_size=1_8    , )

         key_text.move_to([-5, 2.4, 0]      )

         step_a.move_to([2, 2, 0]      )
         self.play(Write(__lowercase    , run_time=2.5      )    , Write(__lowercase      )    , Write(__lowercase      )      )

         self.add(__lowercase      )

         lowerCAmelCase__			:Optional[Any]											=							[]
         lowerCAmelCase__			:List[Any]											=							[]
         lowerCAmelCase__			:Dict											=							[]
         for i, rect in enumerate(__lowercase      ):
           lowerCAmelCase__			:Union[str, Any]											=							Rectangle(height=0.46    , width=0.46      ).set_stroke(width=0.0      ).set_fill(__lowercase    , opacity=0.7      )
           cpu_target.move_to(__lowercase      )
           cpu_target.generate_target()
           lowerCAmelCase__			:Tuple											=							0.46 / 4
           lowerCAmelCase__			:List[Any]											=							0.46 / 3

           if i == 0:
             cpu_target.target.next_to(cpu_left_col_base[0].get_corner(DOWN + LEFT      )    , buff=0.02    , direction=__lowercase      )
             cpu_target.target.set_x(cpu_target.target.get_x() + 0.1      )
           elif i == 3:
             cpu_target.target.next_to(cpu_targs[0].target    , direction=__lowercase    , buff=0.0      )
           else:
             cpu_target.target.next_to(cpu_targs[i - 1].target    , direction=__lowercase    , buff=0.0      )
           cpu_targs.append(__lowercase      )

           first_animations.append(rect.animate(run_time=0.5      ).set_stroke(__lowercase      )      )
           second_animations.append(MoveToTarget(__lowercase    , run_time=1.5      )      )

         self.play(*__lowercase      )
         self.play(*__lowercase      )

         self.wait()






def 						lowerCamelCase__    (		_A							):







	'''simple docstring'''





	if num <= 0:
		raise ValueError("Input must be a positive integer"							)

	snake_case_		    =     [True] * (num + 1)

	snake_case_		    =     2
	while p * p <= num:
		if primes[p]:
			for i in range(p * p     ,	num + 1     ,	_A							):
				snake_case_		    =     False
		p += 1

	return [prime for prime in range(2     ,	num + 1							) if primes[prime]]


if __name__ == "__main__":
		import doctest

		doctest.testmod()

		lowercase__				:     Tuple 		=						int(input("Enter a positive integer: ").strip())
		print(prime_sieve_eratosthenes(user_num))
