This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A212713 #16 Jan 29 2025 15:59:27 %S A212713 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, %T A212713 13,16,11,22,25,4,13,22,13,40,41,14,41,44,5,14,23,16,41,50,17,44,53,2, %U A212713 5,8,11,14,17,20,23,26,7,16,25,22,41,44,23,50,53,8 %N 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. %C A212713 The corresponding sequence using binary representations is given in A163381. %H A212713 Alois P. Heinz, <a href="/A212713/b212713.txt">Table of n, a(n) for n = 1..6559</a> %e A212713 For n=10, the rotations are 101(base 3)=10, 011=4, and 110=12, so a(10)=4. %p A212713 a:= proc(n) local i, k, m, s; %p A212713 k, m, s:= ilog[3](n), n, n; %p A212713 for i to k do m:= iquo(m, 3, 'd') +d*3^k; s:=s, m od; %p A212713 min(s) %p A212713 end: %p A212713 seq(a(n), n=1..80); # _Alois P. Heinz_, May 24 2012 %t A212713 a = {}; For[n = 1, n <= 100, n++, {m = n; d = IntegerDigits[n, 3]; %t A212713 For[k = 1, k <= Length[d], k++, {d = RotateLeft[d]; v = FromDigits[d, 3]; If[v < m, m = v]; }]; AppendTo[a, m]}]; a %t A212713 smr3[n_]:=With[{id3=IntegerDigits[n,3]},Min[FromDigits[#,3]&/@Table[RotateRight[id3,k],{k,Length[id3]}]]]; Array[smr3,80] (* _Harvey P. Dale_, Jan 29 2025 *) %Y A212713 Cf. A163381. %K A212713 nonn,base,look %O A212713 1,2 %A A212713 _John W. Layman_, May 24 2012