%I #20 Dec 19 2021 08:22:36
%S 12,19,28,35,44,49,50,52,56,71,75,77,78,83,92,99,108,113,114,116,120,
%T 135,139,141,142,147,156,163,172,177,178,180,184,195,197,198,201,202,
%U 204,209,210,212,216,225,226,228,232,240,271,279,283,285,286,295,299
%N Numbers whose base-4 representation has the same nonzero number of 0's and 3's.
%t Select[Range[300],DigitCount[#,4,0]==DigitCount[#,4,3]>0&] (* _Harvey P. Dale_, Oct 30 2021 *)
%o (Python)
%o from sympy.ntheory import count_digits
%o def ok(n): c = count_digits(n, 4); return c[0] == c[3] > 0
%o print([k for k in range(300) if ok(k)]) # _Michael S. Branicky_, Dec 19 2021
%Y Cf. A007090.
%Y Supersequence of A045067.
%K nonn,base,easy
%O 1,1
%A _Olivier GĂ©rard_
|