login
A039358
Numbers whose base-9 representation has the same nonzero number of 0's and 2's.
10
18, 83, 99, 163, 165, 166, 167, 168, 169, 170, 171, 189, 198, 207, 216, 225, 234, 245, 261, 326, 342, 407, 423, 488, 504, 569, 585, 650, 666, 740, 748, 750, 751, 752, 753, 754, 755, 758, 767, 776, 785, 794, 803, 812, 828, 892, 894, 895, 896, 897, 898, 899, 900
OFFSET
1,1
LINKS
MATHEMATICA
Select[Range[1000], DigitCount[#, 9, 0]==DigitCount[#, 9, 2]>0&] (* Harvey P. Dale, Jan 03 2024 *)
PROG
(MATLAB)
a = NaN(53, 1); k = 0; j = 1;
while any(isnan(a))
d = dec2base(k, 9)-'0';
n1 = sum(d==0); n2 = sum(d==2);
if n1==n2 && n1 > 0
a(j) = k; j = j+1;
end
k = k+1;
end
disp(regexprep(num2str(a'), ' +', ', ')) % Chris R. Rehmann, Apr 03 2026
KEYWORD
nonn,base,easy
STATUS
approved