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.

A070837 Smallest number k such that abs(k - R(k)) = 9n, where R(k) is digit reversal of k (A004086); or 0 if no such k exists.

Original entry on oeis.org

10, 13, 14, 15, 16, 17, 18, 19, 90, 1011, 100, 0, 0, 0, 0, 0, 0, 0, 0, 1021, 1090, 103, 0, 0, 0, 0, 0, 0, 0, 1031, 1080, 0, 104, 0, 0, 0, 0, 0, 0, 1041, 1070, 0, 0, 105, 0, 0, 0, 0, 0, 1051, 1060, 0, 0, 0, 106, 0, 0, 0, 0, 1061, 1050, 0, 0, 0, 0, 107, 0, 0, 0, 1071, 1040, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Amarnath Murthy, May 12 2002

Keywords

Comments

If 9n < 1000, k has at most 5 digits, and abs(k - R(k)) = 9n, then 10 must divide n. - Sascha Kurz, Jan 02 2003

Crossrefs

Programs

  • Mathematica
    a = Table[0, {50}]; Do[d = Abs[n - FromDigits[ Reverse[ IntegerDigits[n]]]] / 9; If[d < 51 && a[[d]] == 0, a[[d]] = n], {n, 1, 10^7}]; a
  • Python
    def back_difference(n):
        r = int(str(n)[::-1])
        return abs(r-n)
    def a070837(n):
        i = 0
        while True:
            if back_difference(i)==9*n:
                return i
            i+=1
    # Christian Perfect, Jul 23 2015

Extensions

More terms from Sascha Kurz, Jan 02 2003
a(21) corrected by Christian Perfect, Jul 23 2015