





from __future__ import annotations

import math


def     lowerCamelCase_	(      lowerCAmelCase:	Optional[int]				)->		Any:



  if 1 < number < 4:
    # 2 and 3 are primes
    return True
  elif number < 2 or number % 2 == 0 or number % 3 == 0:
    # Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
    return False

  # All primes number are in format of 6k +/- 1
  for i in range(5    ,							int(math.sqrt(lowerCAmelCase_				) + 1				)    ,							6				):
    if number % i == 0 or number % (i + 2) == 0:
      return False
  return True


def     lowerCamelCase_	(      lowerCAmelCase:	int				)->		List[Any]:
  _snake_case   :				Dict														=	str(lowerCAmelCase_				)
  _snake_case   :				Dict														=	[n]
  for i in range(1    ,							len(lowerCAmelCase_				)				):
    list_nums.append(int(str_num[i:]				)				)
    list_nums.append(int(str_num[:-i]				)				)
  return list_nums


def     lowerCamelCase_	(      lowerCAmelCase:	List[Any]				)->		Optional[int]:



  if len(str(lowerCAmelCase_				)				) > 3:
    if not is_prime(int(str(lowerCAmelCase_				)[-3:]				)				) or not is_prime(int(str(lowerCAmelCase_				)[:3]				)				):
      return False
  return True


def     lowerCamelCase_	(      lowerCAmelCase:	Optional[int] = 11				)->		Optional[int]:
  _snake_case   :				list[int]														=	[]
  _snake_case   :				str														=	13
  while len(lowerCAmelCase_				) != count:
    if validate(lowerCAmelCase_				):
      _snake_case   :				Dict														=	list_truncated_nums(lowerCAmelCase_				)
      if all(is_prime(lowerCAmelCase_				) for i in list_nums				):
        list_truncated_primes.append(lowerCAmelCase_				)
    num += 2
  return list_truncated_primes


def     lowerCamelCase_	(      )->		str:
  return sum(compute_truncated_primes(11				)				)


if __name__ == "__main__":
      print(F"""{sum(compute_truncated_primes(11)) = }""")











from random import randint, random


def     lowerCamelCase_	(      lowerCAmelCase:	int    ,							lowerCAmelCase:	int    ,							lowerCAmelCase:	int    ,							lowerCAmelCase:	bool = False    ,							lowerCAmelCase:	bool = False    ,							lowerCAmelCase:	int = 5    ,							)->		list:
  _snake_case   :				Dict														=	[[-1] * number_of_cells]  # Create a highway without any car
  _snake_case   :				List[str]														=	0
  _snake_case   :				List[str]														=	max(lowerCAmelCase    ,							0				)
  while i < number_of_cells:
    _snake_case   :				Optional[Any]														=	(
        randint(0    ,							lowerCAmelCase				) if random_speed else initial_speed
    )  # Place the cars
    i += (
        randint(1    ,							max_speed * 2				) if random_frequency else frequency
    )  # Arbitrary number, may need tuning
  return highway


def     lowerCamelCase_	(      lowerCAmelCase:	list    ,							lowerCAmelCase:	int				)->		int:
  _snake_case   :				Dict														=	0
  _snake_case   :				Optional[Any]														=	highway_now[car_index + 1 :]
  for cell in range(len(lowerCAmelCase				)				):  # May need a better name for this
    if cells[cell] != -1:  # If the cell is not empty then
      return distance  # we have the distance we wanted
    distance += 1
  # Here if the car is near the end of the highway
  return distance + get_distance(lowerCAmelCase    ,							-1				)


def     lowerCamelCase_	(      lowerCAmelCase:	list    ,							lowerCAmelCase:	float    ,							lowerCAmelCase:	int				)->		list:
  _snake_case   :				List[Any]														=	len(lowerCAmelCase				)
  # Beforce calculations, the highway is empty
  _snake_case   :				List[Any]														=	[-1] * number_of_cells

  for car_index in range(lowerCAmelCase				):
    if highway_now[car_index] != -1:
      # Add 1 to the current speed of the car and cap the speed
      _snake_case   :				int														=	min(highway_now[car_index] + 1    ,							lowerCAmelCase				)
      # Number of empty cell before the next car
      _snake_case   :				Tuple														=	get_distance(lowerCAmelCase    ,							lowerCAmelCase				) - 1
      # We can't have the car causing an accident
      _snake_case   :				Union[str, Any]														=	min(next_highway[car_index]    ,							lowerCAmelCase				)
      if random() < probability:
        # Randomly, a driver will slow down
        _snake_case   :				int														=	max(next_highway[car_index] - 1    ,							0				)
  return next_highway


def     lowerCamelCase_	(      lowerCAmelCase:	list    ,							lowerCAmelCase:	int    ,							lowerCAmelCase:	float    ,							lowerCAmelCase:	int				)->		list:
  _snake_case   :				Dict														=	len(highway[0]				)

  for i in range(lowerCAmelCase				):
    _snake_case   :				Any														=	update(highway[i]    ,							lowerCAmelCase    ,							lowerCAmelCase				)
    _snake_case   :				Tuple														=	[-1] * number_of_cells

    for car_index in range(lowerCAmelCase				):
      _snake_case   :				Union[str, Any]														=	next_speeds_calculated[car_index]
      if speed != -1:
        # Change the position based on the speed (with % to create the loop)
        _snake_case   :				Union[str, Any]														=	(car_index + speed) % number_of_cells
        # Commit the change of position
        _snake_case   :				Tuple														=	speed
    highway.append(lowerCAmelCase				)

  return highway


if __name__ == "__main__":
      import doctest

      doctest.testmod()




