Automorphic Numbers

Published by Matt in

A number n is automorphic if n^2 ends in n.

For example: n=5, n^2=25

Create a function that takes a number and returns true if the number is automorphic, false if it isn't.

Examples

is_automorphic(5) ➞ true

is_automorphic(8) ➞ false

is_automorphic(76) ➞ true

Notes

N/A

Watch a quick demo on how Edabit works.