OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
MAPLE
dmax:= 8: # to get all terms < 4^dmax
T[1, 1, 0]:= {}: T[1, 0, 1]:= {2}: T[1, 0, 0]:= {1, 3}:
for d from 2 to dmax do
for a from 0 to max(d-1, 4) do
for b from 0 to max(d-a, 1) do
T[d, a, b]:= {}:
if a + b <= d-1 and a < d-1 then
T[d, a, b]:= T[d, a, b] union map(t -> (4*t+1, 4*t+3), T[d-1, a, b])
fi;
if a >= 1 then
T[d, a, b]:= T[d, a, b] union map(t -> 4*t, T[d-1, a-1, b])
fi;
if b >= 1 and a < d-1 then
T[d, a, b]:= T[d, a, b] union map(t -> 4*t+2, T[d-1, a, b-1])
fi;
od od od:
sort([seq](op(T[d, 4, 1]), d=5..dmax)); # Robert Israel, Jun 29 2017
MATHEMATICA
Select[Range[4500], DigitCount[#, 4, 0]==4&&DigitCount[#, 4, 2]==1&] (* Harvey P. Dale, May 26 2018 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
STATUS
approved