%I #18 Apr 24 2021 17:42:19
%S 1170,5266,8338,8850,9234,9298,9346,9354,9360,9361,9363,9364,9365,
%T 9366,9367,9370,9378,9386,9394,9402,9426,9490,9554,9618,9682,9874,
%U 10386,10898,11410,11922,13458,17554,21650,25746,29842
%N Numbers having four 2's in base 8.
%H Robert Israel, <a href="/A043432/b043432.txt">Table of n, a(n) for n = 1..10000</a>
%p F:= proc(d) local r, L,M,S, Res; # to get all terms < 8^d
%p Res:= NULL;
%p for S in combinat:-choose(d,d-4) do
%p L:= Vector(d,2);
%p for r from 0 to 7^(d-4)-1 do
%p M:= subs(2=7,convert(r+7^(d-4),base,7)[1..d-4]);
%p L[S]:= Vector(M);
%p Res:= Res, add(8^(i-1)*L[i],i=1..d);
%p od
%p od;
%p sort([Res]);
%p end proc:
%p F(6); # _Robert Israel_, Mar 20 2018
%t Select[Range[0, 30000], DigitCount[#, 8, 2]==4 &] (* _Vincenzo Librandi_, Mar 21 2018 *)
%o (PARI) isok(n) = #select(x->(x==2), digits(n, 8)) == 4; \\ _Michel Marcus_, Mar 21 2018
%Y Cf. A007094.
%K nonn,base
%O 1,1
%A _Clark Kimberling_