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.

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

This page as a plain text file.
%I A351479 #13 Feb 12 2022 13:43:16
%S A351479 123,132,147,174,213,231,312,321,345,354,369,396,417,435,453,471,534,
%T A351479 543,567,576,639,657,675,693,714,741,756,765,789,798,879,897,936,963,
%U A351479 978,987,1023,1032,1047,1074,1203,1227,1230,1272,1302,1320,1407,1470,1704,1722,1740,2013,2031,2103,2127,2130,2172
%N A351479 Numbers whose sum of odd digits is twice the sum of even digits.
%C A351479 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 A351479 a(1) = 123 whose sum of odd digits (4) is twice the sum of even digits (2);
%e A351479 a(2) = 132 whose sum of odd digits (4) is twice the sum of even digits (2);
%e A351479 a(3) = 147 whose sum of odd digits (8) is twice the sum of even digits (4).
%t A351479 Select[Range[2000], Plus @@ Select[IntegerDigits[#], OddQ] == 2 * Plus @@ Select[IntegerDigits[#], EvenQ] &] (* _Amiram Eldar_, Feb 12 2022 *)
%o A351479 (Python)
%o A351479 def ok(n):
%o A351479     ds = list(map(int, str(n)))
%o A351479     return sum(d for d in ds if d%2==1) == 2*sum(d for d in ds if d%2==0)
%o A351479 print([k for k in range(1, 2173) if ok(k)]) # _Michael S. Branicky_, Feb 12 2022
%Y A351479 Cf. A036301, A351478.
%K A351479 base,nonn
%O A351479 1,1
%A A351479 _Carole Dubois_ and _Eric Angelini_, Feb 12 2022