|
|
A000787
|
|
Strobogrammatic numbers: the same upside down.
(Formerly M4480 N1897)
|
|
24
|
|
|
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, 16191
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
COMMENTS
|
Strobogrammatic numbers are a kind of ambigrams that retain the same meaning when viewed upside down. - Daniel Mondot, Sep 27 2016
"Upside down" here means rotated by 180 degrees (i.e., central symmetry), NOT "vertically flipped" (symmetry w.r.t. horizontal line, which are in A045574). - M. F. Hasler, May 04 2012
|
|
REFERENCES
|
N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
|
|
LINKS
|
|
|
MATHEMATICA
|
fQ[n_] := Block[{s = {0, 1, 6, 8, 9}, id = IntegerDigits[n]}, If[ Union[ Join[s, id]] == s && (id /. {6 -> 9, 9 -> 6}) == Reverse[id], True, False]]; Select[ Range[0, 16190], fQ[ # ] &] (* Robert G. Wilson v, Oct 11 2005 *)
|
|
PROG
|
(Python)
from itertools import count, islice, product
def ud(s): return s[::-1].translate({ord('6'):ord('9'), ord('9'):ord('6')})
def agen():
yield from [0, 1, 8]
for d in count(2):
for start in "1689":
for rest in product("01689", repeat=d//2-1):
left = start + "".join(rest)
right = ud(left)
for mid in [[""], ["0", "1", "8"]][d%2]:
yield int(left + mid + right)
|
|
CROSSREFS
|
|
|
KEYWORD
|
base,nonn,easy
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|