OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
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
KEYWORD
nonn,base
AUTHOR
STATUS
approved