OFFSET
1,2
COMMENTS
By rotating the binary digits of n, it is meant: Write n in binary without any leading 0's. To rotate this string to the right, say, by one position, first remove the rightmost digit and then append it on the left side of the remaining string. (So the least significant digit becomes the most significant digit.) Here, leading 0's are not removed after the first rotation, so that each binary string being rotated has the same number of binary digits as n has.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..8192
EXAMPLE
13 in binary is 1101. Rotating this just once to the right, we get 1110, 14 in decimal. If we rotate twice to the right, we would have had 0111 = 7 in decimal. Rotating 3 times, we end up with 1011, which is 11 in decimal. Rotating 4 times, we end up at the beginning with 1101 = 13. 14 is the largest of these, so a(13) = 14.
MAPLE
rot := proc(n, t) convert(n, base, 2) ; bdgs := ListTools[Rotate](%, t) ; add(op(i, bdgs)*2^(i-1), i=1..nops(bdgs)) ; end: A163380 := proc(n) local a, r; a := n ; for r from 1 to ilog2(n) do a := max(a, rot(n, r)) ; od: a; end: seq(A163380(n), n=1..100) ; # R. J. Mathar, Aug 03 2009
MATHEMATICA
Table[With[{d = IntegerDigits[n, 2]}, Max@ Map[FromDigits[#, 2] &@ RotateRight[d, #] &, Range[Length@ d]]], {n, 71}] (* Michael De Vlieger, Sep 23 2017 *)
CROSSREFS
KEYWORD
AUTHOR
Leroy Quet, Jul 25 2009
EXTENSIONS
More terms from R. J. Mathar, Aug 03 2009
STATUS
approved