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.

This page as a plain text file.
%I A214527 #25 Jun 19 2020 04:47:13
%S A214527 101,112,123,134,145,156,167,178,189,202,213,224,235,246,257,268,279,
%T A214527 303,314,325,336,347,358,369,404,415,426,437,448,459,505,516,527,538,
%U A214527 549,606,617,628,639,707,718,729,808,819,909,1010,1021,1032,1043,1054,1065,1076
%N A214527 Numbers k such that the alternating sum of decimal digits of k is zero.
%C A214527 Alternating sum starts with plus after the most significant digit, for example
%C A214527 1+0-1 = 0, so 101 is in the sequence, also
%C A214527 4+3-7 = 0, 1+0-7+6 = 0, so 437 and 1076 are in the sequence.
%o A214527 (Python)
%o A214527 a = []
%o A214527 for n in range(1, 2000):
%o A214527     t = str(n)
%o A214527     s = int(t[0])
%o A214527     s += sum((-1)**i * int(d) for i, d in enumerate(t[1:]))
%o A214527     if s == 0:
%o A214527          a.append(n)
%o A214527 print(a)
%Y A214527 Cf. A135499: same definition except that the alternating sum starts with minus after the most significant digit.
%K A214527 nonn,base,less
%O A214527 1,1
%A A214527 _Alex Ratushnyak_, Aug 08 2012