|
|
A188341
|
|
Numbers having no 0's and not more than one 1 in their representation in base 3.
|
|
8
|
|
|
1, 2, 5, 7, 8, 17, 23, 25, 26, 53, 71, 77, 79, 80, 161, 215, 233, 239, 241, 242, 485, 647, 701, 719, 725, 727, 728, 1457, 1943, 2105, 2159, 2177, 2183, 2185, 2186, 4373, 5831, 6317, 6479, 6533, 6551, 6557, 6559, 6560, 13121, 17495, 18953
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
MAPLE
|
a:= proc(n) option remember; local i, l, m, t;
m:= `if`(n=1, 0, a(n-1));
l:= NULL;
for t while m>0 do l:= l, irem(m, 3, 'm') od;
l:= array([l, 0]);
for i while l[i]=2 do od;
if l[i]=0 then l[i]:= 1
else l[i]:= 2;
if i>1 then l[i-1]:= 1 fi
fi;
add(l[i] *3^(i-1), i=1..t)
end:
|
|
MATHEMATICA
|
okQ[n_]:=DigitCount[n, 3, 0]==0&&DigitCount[n, 3, 1]<2; Select[Range[20000], okQ] (* Harvey P. Dale, Apr 16 2011 *)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|