




import numpy as np






def 						_A						(						_lowercase				)			->				List[str]:


     """simple docstring"""


     __UpperCamelCase,  __UpperCamelCase				=	a.shape
     __UpperCamelCase				=	min(_lowercase			,       _lowercase				)
     __UpperCamelCase				=	np.eye(_lowercase				)
     __UpperCamelCase				=	a.copy()

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

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

          __UpperCamelCase				=	q @ q_k.T
          __UpperCamelCase				=	q_k @ r

     return q, r


if __name__ == "__main__":
    import doctest

    doctest.testmod()






import math






def 						_A						(						_lowercase				)			->				list:


     """simple docstring"""


     if n <= 0:
          raise ValueError('Only positive integers have prime factors'				)
     __UpperCamelCase				=	[]
     while n % 2 == 0:
          pf.append(2				)
          __UpperCamelCase				=	int(n / 2				)
     for i in range(3			,       int(math.sqrt(_lowercase				)				) + 1			,       2				):
          while n % i == 0:
               pf.append(_lowercase				)
               __UpperCamelCase				=	int(n / i				)
     if n > 2:
          pf.append(_lowercase				)
     return pf






def 						_A						(						_lowercase				)			->				int:


     """simple docstring"""


     if n <= 0:
          raise ValueError('Only positive numbers are accepted'				)
     __UpperCamelCase				=	1
     __UpperCamelCase				=	1
     while n % 2 == 0:
          temp += 1
          __UpperCamelCase				=	int(n / 2				)
     div *= temp
     for i in range(3			,       int(math.sqrt(_lowercase				)				) + 1			,       2				):
          __UpperCamelCase				=	1
          while n % i == 0:
               temp += 1
               __UpperCamelCase				=	int(n / i				)
          div *= temp
     if n > 1:
          div *= 2
     return div






def 						_A						(						_lowercase				)			->				int:


     """simple docstring"""


     if n <= 0:
          raise ValueError('Only positive numbers are accepted'				)
     __UpperCamelCase				=	1
     __UpperCamelCase				=	1
     while n % 2 == 0:
          temp += 1
          __UpperCamelCase				=	int(n / 2				)
     if temp > 1:
          s *= (2**temp - 1) / (2 - 1)
     for i in range(3			,       int(math.sqrt(_lowercase				)				) + 1			,       2				):
          __UpperCamelCase				=	1
          while n % i == 0:
               temp += 1
               __UpperCamelCase				=	int(n / i				)
          if temp > 1:
               s *= (i**temp - 1) / (i - 1)
     return int(_lowercase				)






def 						_A						(						_lowercase				)			->				int:


     """simple docstring"""


     __UpperCamelCase				=	n
     for x in set(prime_factors(_lowercase				)				):
          s *= (x - 1) / x
     return int(_lowercase				)


if __name__ == "__main__":
    import doctest

    doctest.testmod()


