A255691 Convert n to base 6, move the most significant digit to the least significant one and convert back to base 10.
0, 1, 2, 3, 4, 5, 1, 7, 13, 19, 25, 31, 2, 8, 14, 20, 26, 32, 3, 9, 15, 21, 27, 33, 4, 10, 16, 22, 28, 34, 5, 11, 17, 23, 29, 35, 1, 7, 13, 19, 25, 31, 37, 43, 49, 55, 61, 67, 73, 79, 85, 91, 97, 103, 109, 115, 121, 127, 133, 139, 145, 151, 157, 163, 169, 175
Offset: 0
Examples
16 in base 6 is 24: moving the most significant digit as the least significant one we have 42 that is 26 in base 10.
Links
- Paolo P. Lava, Table of n, a(n) for n = 0..1000
Programs
-
Maple
with(numtheory): P:=proc(q,h) local a,b,k,n; print(0); for n from 1 to q do a:=convert(n,base,h); b:=[]; for k from 1 to nops(a)-1 do b:=[op(b),a[k]]; od; a:=[a[nops(a)],op(b)]; a:=convert(a,base,h,10); b:=0; for k from nops(a) by -1 to 1 do b:=10*b+a[k]; od; print(b); od; end: P(10^4,6);
-
Mathematica
roll[n_, b_] := Block[{w = IntegerDigits[n, b]}, Append[Rest@ w, First@ w]]; b = 6; FromDigits[#, b] & /@ (roll[#, b] & /@ Range[0, 65]) (* Michael De Vlieger, Mar 04 2015 *) Table[FromDigits[RotateLeft[IntegerDigits[n,6]],6],{n,0,70}] (* Harvey P. Dale, Mar 02 2023 *)
Comments