Given an integer, output a truthy value if it is the same upside-down (rotated 180°) or a falsy value otherwise.
0
, 1
, and 8
have rotational symmetry. 6
becomes 9
and vice versa.
Sequence of numbers producing truthy results: OEIS A000787
0, 1, 8, 11, 69, 88, 96, 101, 111, 181, 609, 619, 689, 808, 818, 888, 906, 916, 986, 1001, 1111, 1691, 1881, 1961, 6009, 6119, 6699, 6889, 6969, 8008, 8118, 8698, 8888, 8968, 9006, 9116, 9696, 9886, 9966, 10001, 10101, 10801, 11011, 11111, 11811, 16091, ...
This question is inspired by my own reputation at the time of posting: 6009
.
raw_input
, the user entered an integer, which would become a string behind the scenes. That's fine. \$\endgroup\$ – mbomb007 Apr 15 '16 at 21:32