Write a Python program to check whether the given number is Automorphic or not.

An Automorphic number is that number whose square ends with the same digits as the original number. Ex -5, 76, etc.

Automorphic numbers

So to check Automorphic number in python, we first need to find the number of digits in the input number. Then find its square and after that will extract last ‘n’ digits from the square and will compare it with the initial input number.


Find all Automorphic numbers in the Interval in Python

The logic of program will remain the same as the above but we need to use a loop and check for each of the numbers in the interval.


Please write your suggestion or doubts below in the comments.

Leave a Reply

5 + 17 =