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.

A214527 Numbers k such that the alternating sum of decimal digits of k is zero.

Original entry on oeis.org

101, 112, 123, 134, 145, 156, 167, 178, 189, 202, 213, 224, 235, 246, 257, 268, 279, 303, 314, 325, 336, 347, 358, 369, 404, 415, 426, 437, 448, 459, 505, 516, 527, 538, 549, 606, 617, 628, 639, 707, 718, 729, 808, 819, 909, 1010, 1021, 1032, 1043, 1054, 1065, 1076
Offset: 1

Views

Author

Alex Ratushnyak, Aug 08 2012

Keywords

Comments

Alternating sum starts with plus after the most significant digit, for example
1+0-1 = 0, so 101 is in the sequence, also
4+3-7 = 0, 1+0-7+6 = 0, so 437 and 1076 are in the sequence.

Crossrefs

Cf. A135499: same definition except that the alternating sum starts with minus after the most significant digit.

Programs

  • Python
    a = []
    for n in range(1, 2000):
        t = str(n)
        s = int(t[0])
        s += sum((-1)**i * int(d) for i, d in enumerate(t[1:]))
        if s == 0:
             a.append(n)
    print(a)