A255594 Convert n to base 9, move least significant digit to most significant digit and convert back to base 10.
0, 1, 2, 3, 4, 5, 6, 7, 8, 1, 10, 19, 28, 37, 46, 55, 64, 73, 2, 11, 20, 29, 38, 47, 56, 65, 74, 3, 12, 21, 30, 39, 48, 57, 66, 75, 4, 13, 22, 31, 40, 49, 58, 67, 76, 5, 14, 23, 32, 41, 50, 59, 68, 77, 6, 15, 24, 33, 42, 51, 60, 69, 78, 7, 16, 25, 34, 43, 52, 61
Offset: 0
Examples
13 in base 9 is 14: moving the least significant digit as the most significant one we have 41 that is 37 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 2 to nops(a) do b:=[op(b),a[k]]; od; a:=[op(b),a[1]]; 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,9);
-
Mathematica
roll[n_, b_] := Block[{w = IntegerDigits[n, b]}, Prepend[Most@ w, Last@ w]]; b = 9; FromDigits[#, b] & /@ (roll[#, b] & /@ Range[0, 69]) (* Michael De Vlieger, Mar 04 2015 *) Table[FromDigits[RotateRight[IntegerDigits[n,9]],9],{n,0,80}] (* Harvey P. Dale, Jun 14 2024 *)
Formula
a(9*n) = n.
a(9^n) = 9^(n-1).
Comments