Your Task
You will write a program or function to return a truthy value if the integer inputted to it is a square repdigit, and a falsy value if it is not. A repdigit is an integer that contains only one digit (e.g. 2
, 44
, 9999
). For the purpose of this challenge, a square repdigit is a repdigit that is the square of a different repdigit.
Input
An integer, in base 10.
Output
A truthy/falsy value that reflects whether the input is a square repdigit
Examples
0 --> falsy
1 --> falsy
2 --> falsy
4 --> truthy
9 --> truthy
11 --> falsy
Scoring
This is code-golf, lowest bytes wins.
4
and9
are indeed the only repdigits that are squares of other repdigits. The last two digits of any repdigit>10 squared contains two different values:1..1 -> ..21, 2..2 -> ..84, 3..3 -> ..89, 4..4 -> ..36, 5..5 -> ..25, 6..6 -> ..36, 7..7 -> ..29, 9..9 -> ..01
. If you square8..8
, the last three digits are544
. \$\endgroup\$ – JungHwan Min Jun 12 '17 at 12:41