login
A031492
Numbers whose base-9 representation has the same number of 0's as 8's.
16
1, 2, 3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 15, 16, 19, 20, 21, 22, 23, 24, 25, 28, 29, 30, 31, 32, 33, 34, 37, 38, 39, 40, 41, 42, 43, 46, 47, 48, 49, 50, 51, 52, 55, 56, 57, 58, 59, 60, 61, 64, 65, 66, 67, 68, 69, 70, 72, 89, 91, 92, 93, 94, 95, 96, 97, 100
OFFSET
1,2
LINKS
MATHEMATICA
Select[Range@100, (s=#; Differences[Count[IntegerDigits[s, 9], #]&/@{0, 8}]=={0})&] (* Giorgos Kalogeropoulos, Jul 04 2021 *)
Select[Range[100], DigitCount[#, 9, 0]==DigitCount[#, 9, 8]&] (* Harvey P. Dale, Mar 09 2023 *)
PROG
(MATLAB)
a = NaN(10000, 1); k = 0; j = 1;
while any(isnan(a))
d = dec2base(k, 9)-'0';
if sum(d==0)==sum(d==8)
a(j) = k; j = j+1;
end
k = k+1;
end
disp(regexprep(num2str(a'), ' +', ', ')) % Chris R. Rehmann, Mar 05 2026
KEYWORD
nonn,base
STATUS
approved