





_UpperCamelCase   :							Tuple     =	(1, 1_5_3, 3_7_0, 3_7_1, 1_6_3_4, 2_4_6_7_8_0_5_1, 1_1_5_1_3_2_2_1_9_0_1_8_7_6_3_9_9_2_5_6_5_0_9_5_5_9_7_9_7_3_9_7_1_5_2_2_4_0_1)
_UpperCamelCase   :							tuple     =	(-1_5_3, -1, 0, 1.2, 2_0_0, "A", [], {}, None)
def 				__UpperCamelCase  (		snake_case     )  ->						bool:


			'''simple docstring'''







			if not isinstance(UpperCamelCase_    ,	UpperCamelCase_     ) or n < 1:
						return False

			# Initialization of sum and number of digits.
			__A				 =       0
			__A				 =       0
			__A				 =       n
			# Calculation of digits of the number
			while temp > 0:
						number_of_digits += 1
						temp //= 1_0
			# Dividing number into separate digits and find Armstrong number
			__A				 =       n
			while temp > 0:
						__A				 =       temp % 1_0
						total += rem**number_of_digits
						temp //= 1_0
			return n == total
def 				__UpperCamelCase  (		snake_case     )  ->						bool:


			'''simple docstring'''







			if not isinstance(UpperCamelCase_    ,	UpperCamelCase_     ) or n < 1:
						return False

			# Init a "histogram" of the digits
			__A				 =       [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
			__A				 =       0
			__A				 =       0
			__A				 =       n
			while temp > 0:
						__A ,						__A				 =       divmod(UpperCamelCase_    ,	1_0     )
						digit_histogram[rem] += 1
						digit_total += 1

			for cnt, i in zip(UpperCamelCase_    ,	range(len(UpperCamelCase_     )     )     ):
						total += cnt * i**digit_total

			return n == total
def 				__UpperCamelCase  (		snake_case     )  ->						bool:


			'''simple docstring'''







			if not isinstance(UpperCamelCase_    ,	UpperCamelCase_     ) or n < 1:
						return False
			__A				 =       len(str(UpperCamelCase_     )     )  # the power that all digits will be raised to
			# check if sum of each digit multiplied expo times is equal to number
			return n == sum(int(UpperCamelCase_     ) ** expo for i in str(UpperCamelCase_     )     )
def 				__UpperCamelCase  (		)  ->						Dict:


			'''simple docstring'''







			__A				 =       int(input('''Enter an integer to see if it is an Armstrong number: '''     ).strip()     )
			print(F"{num} is {'' if armstrong_number(UpperCamelCase_     ) else 'not '}an Armstrong number."     )
			print(F"{num} is {'' if narcissistic_number(UpperCamelCase_     ) else 'not '}an Armstrong number."     )
			print(F"{num} is {'' if pluperfect_number(UpperCamelCase_     ) else 'not '}an Armstrong number."     )


if __name__ == "__main__":
				import doctest

				doctest.testmod()
				main()








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()

