





def 				__UpperCamelCase  (		snake_case     )  ->						int:


   '''simple docstring'''







   return n * (2 * n - 1)
def 				__UpperCamelCase  (		snake_case     )  ->						bool:


   '''simple docstring'''







   __A				 =       (1 + 2_4 * n) ** 0.5
   return ((1 + root) / 6) % 1 == 0
def 				__UpperCamelCase  (		snake_case = 1_4_4     )  ->						int:


   '''simple docstring'''







   __A				 =       start
   __A				 =       hexagonal_num(snake_case     )
   while not is_pentagonal(snake_case     ):
      n += 1
      __A				 =       hexagonal_num(snake_case     )
   return num


if __name__ == "__main__":
    print(F"""{solution()} = """)








import numpy as np
def 				__UpperCamelCase  (		snake_case     )  ->						Any:


   '''simple docstring'''







   __A ,						__A				 =       a.shape
   __A				 =       min(snake_case    ,	snake_case     )
   __A				 =       np.eye(snake_case     )
   __A				 =       a.copy()

   for k in range(t - 1     ):
      # select a column of modified matrix A':
      __A				 =       r[k:, [k]]
      # construct first basis vector
      __A				 =       np.zeros_like(snake_case     )
      __A				 =       1.0
      # determine scaling factor
      __A				 =       np.linalg.norm(snake_case     )
      # construct vector v for Householder reflection
      __A				 =       x + np.sign(x[0]     ) * alpha * ea
      v /= np.linalg.norm(snake_case     )

      # construct the Householder matrix
      __A				 =       np.eye(m - k     ) - 2.0 * v @ v.T
      # pad with ones and zeros as necessary
      __A				 =       np.block([[np.eye(snake_case     ), np.zeros((k, m - k)     )], [np.zeros((m - k, k)     ), q_k]]     )

      __A				 =       q @ q_k.T
      __A				 =       q_k @ r

   return q, r


if __name__ == "__main__":
    import doctest

    doctest.testmod()

