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.

A351478 Numbers whose sum of even digits is twice the sum of odd digits.

This page as a plain text file.
%I A351478 #14 Feb 12 2022 13:43:03
%S A351478 12,21,36,63,102,114,120,138,141,183,201,210,234,243,258,285,306,318,
%T A351478 324,342,360,381,411,423,432,456,465,528,546,564,582,603,630,645,654,
%U A351478 678,687,768,786,813,825,831,852,867,876,1002,1014,1020,1038,1041,1083,1104,1116,1122,1140,1161,1200,1212
%N A351478 Numbers whose sum of even digits is twice the sum of odd digits.
%C A351478 The sequence is closed under concatenation (if k and m are terms, so are k.m and m.k); permutation of a term's string of digits; and insertion of 0's within a term's string of digits. - _Michael S. Branicky_, Feb 12 2022
%e A351478 a(1) = 12 whose sum of even digits (4) is twice the sum of odd digits (2);
%e A351478 a(2) = 21 whose sum of even digits (4) is twice the sum of odd digits (2);
%e A351478 a(3) = 36 whose sum of even digits (6) is twice the sum of odd digits (3);
%e A351478 etc.
%t A351478 Select[Range[1000], Plus @@ Select[IntegerDigits[#], EvenQ] == 2 * Plus @@ Select[IntegerDigits[#], OddQ] &] (* _Amiram Eldar_, Feb 12 2022 *)
%o A351478 (Python)
%o A351478 def ok(n):
%o A351478     ds = list(map(int, str(n)))
%o A351478     return sum(d for d in ds if d%2==0) == 2*sum(d for d in ds if d%2==1)
%o A351478 print([k for k in range(1, 2173) if ok(k)]) # _Michael S. Branicky_, Feb 12 2022
%Y A351478 Cf. A036301, A351479.
%K A351478 base,nonn
%O A351478 1,1
%A A351478 _Eric Angelini_ and _Carole Dubois_, Feb 12 2022