OFFSET
0,3
COMMENTS
On the graph, there are a series of larger and larger parallelograms joined together by a straight line on y=x where n is unchanged, mostly in the case where n is a multiple of the bit length of n. In addition to the main line that cuts through the graph, each parallelogram has the same few sloped lines in its borders.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..16384
EXAMPLE
a(3) = a('11') = '11' = 3;
a(4) = a('100') = '010' = '10' = 2;
a(5) = a('101') = '011' = '11' = 3;
MATHEMATICA
Array[FromDigits[RotateRight[IntegerDigits[#, 2], #], 2] &, 68, 0] (* Michael De Vlieger, Oct 05 2020 *)
PROG
(PARI) a(n) = my(d=binary(n)); for (k=1, n, d = concat(d[#d], d[1..#d-1])); fromdigits(d, 2); \\ Michel Marcus, Aug 09 2020
(Python)
def A336953(n):
if n == 0: return 0
l, m = -(n%n.bit_length()), bin(n)[2:]
return int(m[l:]+m[:l], 2) # Chai Wah Wu, Jan 22 2023
CROSSREFS
KEYWORD
AUTHOR
Gage Schacher, Aug 08 2020
STATUS
approved