login
Numbers whose base-12 representation has the same number of 8's and 9's.
0

%I #15 Apr 02 2024 14:35:09

%S 0,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,18,19,22,23,24,25,26,27,28,

%T 29,30,31,34,35,36,37,38,39,40,41,42,43,46,47,48,49,50,51,52,53,54,55,

%U 58,59,60,61,62,63,64,65,66,67,70,71,72,73,74,75,76,77,78,79,82,83

%N Numbers whose base-12 representation has the same number of 8's and 9's.

%t Select[Range[0,100],DigitCount[#,12,8]==DigitCount[#,12,9]&] (* _Harvey P. Dale_, Jan 13 2021 *)

%o (Python)

%o from itertools import count, islice

%o from sympy.ntheory import digits

%o def A039269_gen(startvalue=0): # generator of terms >= startvalue

%o return filter(lambda n:(s:=digits(n,12)[1:]).count(8)==s.count(9),count(max(startvalue,0)))

%o A039269_list = list(islice(A039269_gen(),30)) # _Chai Wah Wu_, Apr 02 2024

%K nonn,base,easy

%O 1,3

%A _Olivier GĂ©rard_