Automorphic number
Square the given number. If the given number is present in the squared number in last means, that is called Automorphic number.
Example-1:
Input : N = 5 Output : Automorphic number Explain : 52 = 25
Example-2:
Input : N = 6 Output : Automorphic number Explain : 62 = 36
Example-3:
Input : N = 76 Output : Automorphic number Explain : 762 = 5776
Example-4:
Input : N = 7 Output : Not a Automorphic number Explain : 72 = 49
Solution
n = 5 a = (n*n) b = str(a) c = len(str(n)) if(str(n)==b[-c:]): print("Automorphic number") else: print("Not a Automorphic number")
Output
Automorphic number