"""simple docstring"""


lowerCAmelCase_:       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)
lowerCAmelCase_:       tuple			     =       (-1_5_3, -1, 0, 1.2, 2_0_0, "A", [], {}, None)







def        __a (		A   ):






     '''simple docstring'''



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

     # Initialization of sum and number of digits.
     lowercase__								=				0
     lowercase__								=				0
     lowercase__								=				n
     # Calculation of digits of the number
     while temp > 0:
          number_of_digits += 1
          temp //= 10
     # Dividing number into separate digits and find Armstrong number
     lowercase__								=				n
     while temp > 0:
          lowercase__								=				temp % 10
          total += rem**number_of_digits
          temp //= 10
     return n == total







def        __a (		A   ):






     '''simple docstring'''



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

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

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

     return n == total







def        __a (		A   ):






     '''simple docstring'''



     if not isinstance(A     ,					A   ) or n < 1:
          return False
     lowercase__								=				len(str(A   )   )  # 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(A   ) ** expo for i in str(A   )   )







def        __a (		):






     '''simple docstring'''



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


if __name__ == "__main__":
 import doctest

 doctest.testmod()
 main()





"""simple docstring"""


import qiskit
from qiskit.providers import Backend







def        __a (		A     ,					A   ):






     '''simple docstring'''



     lowercase__			,    lowercase__								=				bin(A   )[2:], bin(A   )[2:]  # Remove leading '0b'

     # Ensure that both strings are of the same length
     if len(A   ) > len(A   ):
          lowercase__								=				y.zfill(len(A   )   )
     else:
          lowercase__								=				x.zfill(len(A   )   )

     # We need (3 * number of bits in the larger number)+1 qBits
     # The second parameter is the number of classical registers, to measure the result
     lowercase__								=				qiskit.QuantumCircuit((len(A   ) * 3) + 1     ,					len(A   ) + 1   )

     # We are essentially "not-ing" the bits that are 1
     # Reversed because it's easier to perform ops on more significant bits
     for i in range(len(A   )   ):
          if x[::-1][i] == "1":
               circuit.x(A   )
     for j in range(len(A   )   ):
          if y[::-1][j] == "1":
               circuit.x(len(A   ) + j   )

     return circuit, x, y







def        __a (		A     ,					A     ,					A     ,					A     ,					A     ,					):






     '''simple docstring'''



     circuit.ccx(A     ,					A     ,					A   )
     circuit.cx(A     ,					A   )
     circuit.ccx(A     ,					A     ,					A   )
     circuit.cx(A     ,					A   )
     circuit.cx(A     ,					A   )







def        __a (		A     ,					A     ,					A = qiskit.Aer.get_backend("aer_simulator"   )     ,					):






     '''simple docstring'''



     if vala < 0 or vala < 0:
          raise ValueError("Both Integers must be positive!"   )

     # Store the Integers
     lowercase__			,    lowercase__			,    lowercase__								=				store_two_classics(A     ,					A   )
     for i in range(len(A   )   ):
          full_adder(A     ,					A     ,					len(A   ) + i     ,					len(A   ) + len(A   ) + i     ,					len(A   ) + len(A   ) + i + 1   )
          circuit.barrier()  # Optional, just for aesthetics

     # Measure the resultant qBits
     for i in range(len(A   ) + 1   ):
          circuit.measure([(len(A   ) * 2) + i]     ,					[i]   )

     lowercase__								=				qiskit.execute(A     ,					A     ,					shots=1   ).result()

     # The result is in binary. Convert it back to int
     return int(list(res.get_counts()   )[0]     ,					2   )


if __name__ == "__main__":
 import doctest

 doctest.testmod()




