OFFSET
1,2
COMMENTS
The corresponding sequence using binary representations is given in A163381.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..6559
EXAMPLE
For n=10, the rotations are 101(base 3)=10, 011=4, and 110=12, so a(10)=4.
MAPLE
a:= proc(n) local i, k, m, s;
k, m, s:= ilog[3](n), n, n;
for i to k do m:= iquo(m, 3, 'd') +d*3^k; s:=s, m od;
min(s)
end:
seq(a(n), n=1..80); # Alois P. Heinz, May 24 2012
MATHEMATICA
a = {}; For[n = 1, n <= 100, n++, {m = n; d = IntegerDigits[n, 3];
For[k = 1, k <= Length[d], k++, {d = RotateLeft[d]; v = FromDigits[d, 3]; If[v < m, m = v]; }]; AppendTo[a, m]}]; a
CROSSREFS
KEYWORD
AUTHOR
John W. Layman, May 24 2012
STATUS
approved