A214527 Numbers k such that the alternating sum of decimal digits of k is zero.
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
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)
Comments