login
A043432
Numbers having four 2's in base 8.
1
1170, 5266, 8338, 8850, 9234, 9298, 9346, 9354, 9360, 9361, 9363, 9364, 9365, 9366, 9367, 9370, 9378, 9386, 9394, 9402, 9426, 9490, 9554, 9618, 9682, 9874, 10386, 10898, 11410, 11922, 13458, 17554, 21650, 25746, 29842
OFFSET
1,1
LINKS
MAPLE
F:= proc(d) local r, L, M, S, Res; # to get all terms < 8^d
Res:= NULL;
for S in combinat:-choose(d, d-4) do
L:= Vector(d, 2);
for r from 0 to 7^(d-4)-1 do
M:= subs(2=7, convert(r+7^(d-4), base, 7)[1..d-4]);
L[S]:= Vector(M);
Res:= Res, add(8^(i-1)*L[i], i=1..d);
od
od;
sort([Res]);
end proc:
F(6); # Robert Israel, Mar 20 2018
MATHEMATICA
Select[Range[0, 30000], DigitCount[#, 8, 2]==4 &] (* Vincenzo Librandi, Mar 21 2018 *)
PROG
(PARI) isok(n) = #select(x->(x==2), digits(n, 8)) == 4; \\ Michel Marcus, Mar 21 2018
CROSSREFS
Cf. A007094.
Sequence in context: A185468 A209825 A264688 * A065703 A202487 A230946
KEYWORD
nonn,base
STATUS
approved