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.

A053701 Vertically symmetric numbers.

Original entry on oeis.org

0, 1, 8, 11, 25, 52, 88, 101, 111, 181, 205, 215, 285, 502, 512, 582, 808, 818, 888, 1001, 1111, 1251, 1521, 1881, 2005, 2115, 2255, 2525, 2885, 5002, 5112, 5252, 5522, 5882, 8008, 8118, 8258, 8528, 8888, 10001, 10101, 10801, 11011, 11111, 11811
Offset: 1

Views

Author

Henry Bottomley, Feb 14 2000

Keywords

Comments

Numbers that are symmetric about a vertical mirror.
2 and 5 are taken as mirror images (as on calculator displays).

Crossrefs

Cf. A000787, A007284, A018846 (strobogrammatic numbers).

Programs

  • Maple
    compdig := proc(n) if(n=2)then return 5: elif(n=5)then return 2: elif(n=0 or n=1 or n=8)then return n: else return -1: fi: end: isA053701 := proc(n) local d,l,j: d:=convert(n,base,10): l:=nops(d): for j from 1 to ceil(l/2) do if(not d[j]=compdig(d[l-j+1]))then return false: fi: od: return true: end: for n from 0 to 10000 do if(isA053701(n))then printf("%d, ",n): fi: od: # Nathaniel Johnston, May 17 2011
  • Python
    from itertools import count, islice, product
    def lr(s): return s[::-1].translate({ord('2'):ord('5'), ord('5'):ord('2')})
    def A053701gen(): # generator of terms
        yield from [0, 1, 8]
        for d in count(2):
            for first in "1258":
                for rest in product("01258", repeat=d//2-1):
                    left = first + "".join(rest)
                    for mid in [[""], ["0", "1", "8"]][d%2]:
                        yield int(left + mid + lr(left))
    print(list(islice(A053701gen(), 45))) # Michael S. Branicky, Jul 09 2022

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Oct 01 2001