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.

A325483 Numbers whose sum of their decimal digits is less than or equal to the sum of the digits of their binary representation.

This page as a plain text file.
%I A325483 #28 Oct 11 2021 04:21:02
%S A325483 0,1,10,11,20,21,30,31,100,101,102,103,110,111,120,121,122,123,200,
%T A325483 201,202,203,210,211,220,221,222,223,230,231,300,301,302,303,310,311,
%U A325483 410,411,500,501,502,503,510,511,1000,1001,1002,1003,1004,1005,1006,1007
%N A325483 Numbers whose sum of their decimal digits is less than or equal to the sum of the digits of their binary representation.
%H A325483 Alois P. Heinz, <a href="/A325483/b325483.txt">Table of n, a(n) for n = 1..10000</a>
%F A325483 { A037308 } union { A108580 }.
%p A325483 q:= n-> (f-> is(f(n, 10)<=f(n, 2)))((x, b)
%p A325483           -> add(i, i=convert(x, base, b))):
%p A325483 select(q, [$0..1500])[];  # _Alois P. Heinz_, Sep 06 2019
%t A325483 Select[Range[0,1007], Total[IntegerDigits[#]]<=Total[IntegerDigits[#,2]]&] (* _Metin Sariyar_, Sep 14 2019 *)
%o A325483 (Python)
%o A325483 x=0
%o A325483 #Adjust the inequality below to generate more numbers of the sequence
%o A325483 while(x<100):
%o A325483     x = x+1
%o A325483     Number = int(bin(x)[2:])
%o A325483     Bin_Sum = 0
%o A325483     while(Number > 0):
%o A325483         Reminder = Number % 10
%o A325483         Bin_Sum = Bin_Sum + Reminder
%o A325483         Number = Number //10
%o A325483     Number = x
%o A325483     Sum = 0
%o A325483     while(Number > 0):
%o A325483         Reminder = Number % 10
%o A325483         Sum = Sum + Reminder
%o A325483         Number = Number //10
%o A325483     if (Sum <= Bin_Sum):
%o A325483         print(x)
%o A325483 (Python)
%o A325483 def ok(n): return sum(map(int, str(n))) <= bin(n).count('1')
%o A325483 print(list(filter(ok, range(1008)))) # _Michael S. Branicky_, Oct 11 2021
%o A325483 (PARI) isok(n) = sumdigits(n, 10) <= sumdigits(n, 2); \\ _Michel Marcus_, Sep 07 2019
%Y A325483 Supersequence of A037308 and A108580.
%Y A325483 Cf. A000120, A007953.
%K A325483 nonn,base
%O A325483 1,3
%A A325483 _Frederick John Bernet III_, Sep 06 2019