login
A214527
Numbers k such that the alternating sum of decimal digits of k is zero.
2
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,1
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.
PROG
(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)
CROSSREFS
Cf. A135499: same definition except that the alternating sum starts with minus after the most significant digit.
Sequence in context: A267585 A294743 A352439 * A084413 A248533 A069691
KEYWORD
nonn,base,less
AUTHOR
Alex Ratushnyak, Aug 08 2012
STATUS
approved