





from __future__ import annotations

__lowercase				    =      """Alexander Joslin"""


def        __SCREAMING_SNAKE_CASE	(				__lowercase:		int):



  '''simple docstring'''






  if number <= 0:
    __lowerCAmelCase								=					F'''n must be greater than 0. Got n = {number}'''
    raise ValueError(__lowercase)

  __lowerCAmelCase								=					[number + 1] * (number + 1)

  # starting position
  __lowerCAmelCase								=					0
  for i in range(1  ,				__lowercase):
    __lowerCAmelCase								=					min(table[i + 1]  ,				table[i] + 1)
    # check if out of bounds
    if i * 2 <= number:
      __lowerCAmelCase								=					min(table[i * 2]  ,				table[i] + 1)
    # check if out of bounds
    if i * 3 <= number:
      __lowerCAmelCase								=					min(table[i * 3]  ,				table[i] + 1)
  return table[number]


if __name__ == "__main__":
      import doctest

      doctest.testmod()







def        __SCREAMING_SNAKE_CASE	(				__lowercase:		int):



  '''simple docstring'''






  if not isinstance(__lowercase  ,				__lowercase):
    __lowerCAmelCase								=					F'''Input value of [number={number}] must be an integer'''
    raise TypeError(__lowercase)
  if number < 0 or number % 2 == 1:
    return False
  __lowerCAmelCase								=					int(number**0.5)
  return number == number_sqrt * (number_sqrt + 1)


if __name__ == "__main__":
      import doctest

      doctest.testmod()
