

'''simple docstring'''



def   a__			(    a__		):




     """simple docstring"""


     if length <= 0 or not isinstance(a__ ,       a__		):
          raise ValueError("""Length must be a positive integer."""		)
     return [n * (2 * n - 1) for n in range(a__		)]


if __name__ == "__main__":
  print(hexagonal_numbers(length=5))
  print(hexagonal_numbers(length=1_0))









'''simple docstring'''



import math







def   a__			(    a__		):




     """simple docstring"""


     return math.sqrt(a__		) * math.sqrt(a__		) == num







def   a__			(    a__		):




     """simple docstring"""


     __SCREAMING_SNAKE_CASE      = 0
     __SCREAMING_SNAKE_CASE      = n
     while left <= right:
          __SCREAMING_SNAKE_CASE      = (left + right) // 2
          if mid**2 == n:
               return True
          elif mid**2 > n:
               __SCREAMING_SNAKE_CASE      = mid - 1
          else:
               __SCREAMING_SNAKE_CASE      = mid + 1
     return False


if __name__ == "__main__":
  import doctest

  doctest.testmod()






