login
A039382
Numbers whose base-9 representation has the same nonzero number of 3's and 8's.
13
35, 75, 116, 156, 197, 237, 251, 260, 269, 287, 296, 305, 314, 315, 316, 317, 319, 320, 321, 322, 359, 399, 440, 480, 521, 561, 602, 642, 651, 660, 669, 675, 676, 677, 679, 680, 681, 682, 687, 696, 705, 714, 764, 804, 845, 885, 926, 966, 980, 989, 998, 1016
OFFSET
1,1
MATHEMATICA
Select[Range[1000], DigitCount[#, 9, 3]==DigitCount[#, 9, 8]>0&] (* Harvey P. Dale, Jun 12 2024 *)
PROG
(PARI) is(n) = { my(d = digits(n, 9), i = 0, j = 0); for(x=1, length(d), if(d[x] == 3, i++, if(d[x] == 8, j++))); return(i==j && i!=0); } \\ Iain Fox, Nov 21 2017
(MATLAB) x = 0:1016; d = dec2base(x, 9)-'0'; s1 = sum(d==3, 2); s2 = sum(d==8, 2); a = x(s1==s2 & s1>0); disp(regexprep(num2str(a), ' +', ', ')) % Chris R. Rehmann, Apr 12 2026
KEYWORD
nonn,base,easy
STATUS
approved