cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A018846 Strobogrammatic numbers: numbers that are the same upside down (using calculator-style numerals).

This page as a plain text file.
%I A018846 #21 Jul 09 2022 11:06:13
%S A018846 0,1,2,5,8,11,22,55,69,88,96,101,111,121,151,181,202,212,222,252,282,
%T A018846 505,515,525,555,585,609,619,629,659,689,808,818,828,858,888,906,916,
%U A018846 926,956,986,1001,1111,1221,1551,1691,1881,1961,2002,2112,2222,2552,2692,2882
%N A018846 Strobogrammatic numbers: numbers that are the same upside down (using calculator-style numerals).
%C A018846 A018847 lists primes in this sequence. - _M. F. Hasler_, May 05 2012
%H A018846 Michael S. Branicky, <a href="/A018846/b018846.txt">Table of n, a(n) for n = 1..10000</a> (terms 1..1000 from T. D. Noe)
%o A018846 (PARI) is_A018846(n,t=Vec("012..59.86"))={ apply(x->t[eval(x)+1], n=Vec(Str(n)))==vecextract(n, "-1..1") } \\ _M. F. Hasler_, May 05 2012
%o A018846 (Python)
%o A018846 from itertools import count, islice, product
%o A018846 def ud(s): return s[::-1].translate({ord('6'):ord('9'), ord('9'):ord('6')})
%o A018846 def A018846gen(): # generator of terms
%o A018846     yield from [0, 1, 2, 5, 8]
%o A018846     for d in count(2):
%o A018846         for first in "125689":
%o A018846             for rest in product("0125689", repeat=d//2-1):
%o A018846                 left = first + "".join(rest)
%o A018846                 for mid in [[""], ["0", "1", "2", "5", "8"]][d%2]:
%o A018846                     yield int(left + mid + ud(left))
%o A018846 print(list(islice(A018846gen(), 54))) # _Michael S. Branicky_, Jul 09 2022
%Y A018846 Cf. A053701 (vertically symmetric numbers), A048708.
%K A018846 nonn,base,easy,nice
%O A018846 1,3
%A A018846 _David W. Wilson_