7 kyu

Automorphic Number (Special Numbers Series #6)

1,615 of 12,289MrZizoScream

Description:

A number is called Automorphic number if and only if its square ends in the same digits as the number itself. For example, 25 is an automorphic number because its square (625) ends with 25.

Task

Given a positive number, determine if it is Automorphic or not. If it is, return "Automorphic", otherwise return "Not!!"

Examples

  • 25 is an automorphic number, because 252=625 25^2 = 625 ends with 25, so return "Automorphic".
  • 13 is not an automorphic number, because 132=169 13^2 = 169 does not end with 13, so return "Not!!".
  • 76 is an automorphic number, because 762=5776 76^2 = 5776 ends with 76, so return "Automorphic".
  • 225 is not an automorphic number, because 2252=50625 225^2 = 50625 does not end with 225, so return "Not!!".
  • 625 is an automorphic number, because 6252=390625 625^2 = 390625 ends with 625, so return "Automorphic".
  • 1 is an automorphic number, because 12=1 1^2 = 1 ends with 1, so return "Automorphic".
  • 6 is an automorphic number, because 62=36 6^2 = 36 ends with 6, so return "Automorphic".

Playing with Numbers Series

Playing With Lists/Arrays Series

For More Enjoyable Katas

Fundamentals
Mathematics

Stats:

CreatedJan 12, 2018
PublishedJan 12, 2018
Warriors Trained17157
Total Skips1078
Total Code Submissions34491
Total Times Completed12289
C++ Completions821
JavaScript Completions3976
Python Completions3819
Crystal Completions14
Ruby Completions268
C Completions318
Java Completions1615
C# Completions566
Haskell Completions113
NASM Completions21
PHP Completions282
Julia Completions31
Dart Completions387
TypeScript Completions263
CoffeeScript Completions14
Prolog Completions24
Clojure Completions43
Rust Completions204
F# Completions30
R Completions59
COBOL Completions5
Total Stars147
% of votes with a positive feedback rating94% of 1612
Total "Very Satisfied" Votes1424
Total "Somewhat Satisfied" Votes167
Total "Not Satisfied" Votes21
Total Rank Assessments21
Average Assessed Rank
7 kyu
Highest Assessed Rank
4 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • MrZizoScream Avatar
  • GiacomoSorbi Avatar
  • imjasonmiller Avatar
  • kazk Avatar
  • JohanWiltink Avatar
  • B1ts Avatar
  • Blind4Basics Avatar
  • Voile Avatar
  • realfg Avatar
  • neilm Avatar
  • rowcased Avatar
  • rsa Avatar
  • clcraig Avatar
  • monadius Avatar
  • cliffstamp Avatar
  • uniapi Avatar
  • stellartux Avatar
  • user8436785 Avatar
  • ch-koehler Avatar
  • ejini战神 Avatar
  • akar-0 Avatar
Ad