


import math
def       UpperCAmelCase__						(UpperCamelCase_    ):



     """simple docstring"""






     snake_case					=    [True] * n
     snake_case					=    False
     snake_case					=    False
     snake_case					=    True

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

     snake_case					=    [2]

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

     return primes
def       UpperCAmelCase__						(UpperCamelCase_ = 99_99_66_66_33_33    ):



     """simple docstring"""






     snake_case					=    math.floor(math.sqrt(UpperCamelCase_    )    ) + 1_00
     snake_case					=    prime_sieve(UpperCamelCase_    )

     snake_case					=    0
     snake_case					=    0
     snake_case					=    primes[prime_index]

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

          snake_case					=    last_prime**2
          snake_case					=    next_prime**2

          # Get numbers divisible by lps(current)
          snake_case					=    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					=    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					=    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					=    next_prime
          prime_index += 1

     return matches_sum


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








from __future__ import annotations

from scipy.special import comb  # type: ignore

class   A__ :







    """simple docstring"""

    def __init__(	self      , __snake_case   ):
         snake_case					=    list_of_points
         # Degree determines the flexibility of the curve.
         # Degree = 1 will produce a straight line.
         snake_case					=    len(__snake_case   ) - 1
    def 		a_      (	self      , __snake_case   ):
         assert 0 <= t <= 1, "Time t must be between 0 and 1."
         snake_case					=    []
         for i in range(len(self.list_of_points   )   ):
              # basis function for each i
              output_values.append(
                  comb(self.degree      , __snake_case   ) * ((1 - t) ** (self.degree - i)) * (t**i)   )
         # the basis must sum up to 1 for it to produce a valid Bezier curve.
         assert round(sum(__snake_case   )      , 5   ) == 1
         return output_values
    def 		a_      (	self      , __snake_case   ):
         assert 0 <= t <= 1, "Time t must be between 0 and 1."

         snake_case					=    self.basis_function(__snake_case   )
         snake_case					=    0.0
         snake_case					=    0.0
         for i in range(len(self.list_of_points   )   ):
              # For all points, sum up the product of i-th basis function and i-th point.
              x += basis_function[i] * self.list_of_points[i][0]
              y += basis_function[i] * self.list_of_points[i][1]
         return (x, y)




    def 		a_      (	self      , __snake_case = 0.01   ):
         from matplotlib import pyplot as plt  # type: ignore

         snake_case					=    []  # x coordinates of points to plot
         snake_case					=    []  # y coordinates of points to plot

         snake_case					=    0.0
         while t <= 1:
              snake_case					=    self.bezier_curve_function(__snake_case   )
              to_plot_x.append(value[0]   )
              to_plot_y.append(value[1]   )
              t += step_size

         snake_case					=    [i[0] for i in self.list_of_points]
         snake_case					=    [i[1] for i in self.list_of_points]

         plt.plot(
             __snake_case      , __snake_case      , color='''blue'''      , label='''Curve of Degree ''' + str(self.degree   )      , )
         plt.scatter(__snake_case      , __snake_case      , color='''red'''      , label='''Control Points'''   )
         plt.legend()
         plt.show()


if __name__ == "__main__":
 import doctest

 doctest.testmod()

 BezierCurve([(1, 2), (3, 5)]).plot_curve()  # degree 1
 BezierCurve([(0, 0), (5, 5), (5, 0)]).plot_curve()  # degree 2
 BezierCurve([(0, 0), (5, 5), (5, 0), (2.5, -2.5)]).plot_curve()  # degree 3




