|
|
A212713
|
|
The (decimal equivalent of the) smallest integer that can be made by rotating the base three digits of n any number of positions to the left or right.
|
|
1
|
|
|
1, 2, 1, 4, 5, 2, 5, 8, 1, 4, 7, 4, 13, 14, 5, 14, 17, 2, 5, 8, 7, 14, 17, 8, 17, 26, 1, 4, 7, 10, 13, 16, 11, 22, 25, 4, 13, 22, 13, 40, 41, 14, 41, 44, 5, 14, 23, 16, 41, 50, 17, 44, 53, 2, 5, 8, 11, 14, 17, 20, 23, 26, 7, 16, 25, 22, 41, 44, 23, 50, 53, 8
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
The corresponding sequence using binary representations is given in A163381.
|
|
LINKS
|
|
|
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:
|
|
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
|
|
|
STATUS
|
approved
|
|
|
|