



"""simple docstring"""
import colorsys

from PIL import Image  # type: ignore


def 			_SCREAMING_SNAKE_CASE						(__lowerCAmelCase ,  __lowerCAmelCase ,  __lowerCAmelCase							) ->						Tuple:







  '''simple docstring'''


  lowercase_								= x
  lowercase_								= y
  for step in range(snake_case_							):  # noqa: B007
    lowercase_								= a * a - b * b + x
    lowercase_								= 2 * a * b + y
    lowercase_								= a_new

    # divergence happens for all complex number with an absolute value
    # greater than 4
    if a * a + b * b > 4:
      break
  return step / (max_step - 1)


def 			_SCREAMING_SNAKE_CASE						(__lowerCAmelCase							) ->						Union[str, Any]:







  '''simple docstring'''


  if distance == 1:
    return (0, 0, 0)
  else:
    return (2_55, 2_55, 2_55)


def 			_SCREAMING_SNAKE_CASE						(__lowerCAmelCase							) ->						Any:







  '''simple docstring'''


  if distance == 1:
    return (0, 0, 0)
  else:
    return tuple(round(i * 2_55							) for i in colorsys.hsv_to_rgb(snake_case_ ,  1 ,  1							)							)


def 			_SCREAMING_SNAKE_CASE						(__lowerCAmelCase = 8_00 ,  __lowerCAmelCase = 6_00 ,  __lowerCAmelCase = -0.6 ,  __lowerCAmelCase = 0 ,  __lowerCAmelCase = 3.2 ,  __lowerCAmelCase = 50 ,  __lowerCAmelCase = True ,  ) ->						Optional[Any]:







  '''simple docstring'''


  lowercase_								= Image.new("""RGB""" ,  (image_width, image_height)							)
  lowercase_								= img.load()

  # loop through the image-coordinates
  for image_x in range(snake_case_							):
    for image_y in range(snake_case_							):
      # determine the figure-coordinates based on the image-coordinates
      lowercase_								= figure_width / image_width * image_height
      lowercase_								= figure_center_x + (image_x / image_width - 0.5) * figure_width
      lowercase_								= figure_center_y + (image_y / image_height - 0.5) * figure_height

      lowercase_								= get_distance(snake_case_ ,  snake_case_ ,  snake_case_							)

      # color the corresponding pixel based on the selected coloring-function
      if use_distance_color_coding:
        lowercase_								= get_color_coded_rgb(snake_case_							)
      else:
        lowercase_								= get_black_and_white_rgb(snake_case_							)

  return img


if __name__ == "__main__":
  import doctest

  doctest.testmod()

  # colored version, full figure
  UpperCAmelCase						:		List[Any]			= get_image()

  # uncomment for colored version, different section, zoomed in
  # img = get_image(figure_center_x = -0.6, figure_center_y = -0.4,
  # figure_width = 0.8)

  # uncomment for black and white version, full figure
  # img = get_image(use_distance_color_coding = False)

  # uncomment to save the image
  # img.save("mandelbrot.png")

  img.show()






"""simple docstring"""
def 			_SCREAMING_SNAKE_CASE						(__lowerCAmelCase=2_81_23							) ->						Optional[Any]:







  '''simple docstring'''


  lowercase_								= [1] * (limit + 1)

  for i in range(2 ,  int(limit**0.5							) + 1							):
    sum_divs[i * i] += i
    for k in range(i + 1 ,  limit // i + 1							):
      sum_divs[k * i] += k + i

  lowercase_								= set()
  lowercase_								= 0

  for n in range(1 ,  limit + 1							):
    if sum_divs[n] > n:
      abundants.add(__lowerCAmelCase							)

    if not any((n - a in abundants) for a in abundants							):
      res += n

  return res


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

