cp's OEIS Frontend

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.

Showing 1-3 of 3 results.

A345110 a(n) is n rotated one place to the left or, equivalently, n with the most significant digit moved to the least significant place, omitting leading zeros.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 11, 21, 31, 41, 51, 61, 71, 81, 91, 2, 12, 22, 32, 42, 52, 62, 72, 82, 92, 3, 13, 23, 33, 43, 53, 63, 73, 83, 93, 4, 14, 24, 34, 44, 54, 64, 74, 84, 94, 5, 15, 25, 35, 45, 55, 65, 75, 85, 95, 6, 16, 26, 36, 46, 56, 66, 76, 86
Offset: 0

Views

Author

Felix Fröhlich, Jun 09 2021

Keywords

Comments

First differs from A004086 at n = 101, since A004086(101) = 101, but a(101) = 11.

Examples

			For n = 123: When 123 is rotated one place to the left the resulting number is 231, so a(123) = 231.
		

Crossrefs

Programs

  • Mathematica
    Array[FromDigits@*RotateLeft@*IntegerDigits,100,0] (* Giorgos Kalogeropoulos, Jun 09 2021 *)
  • PARI
    eva(n) = subst(Pol(n), x, 10)
    rot(vec) = if(#vec < 2, return(vec)); my(s=concat(Str(2), ".."), v=[]); s=concat(s, Str(#vec)); v=vecextract(vec, s); v=concat(v, vec[1]); v
    a(n) = eva(rot(digits(n)))
    
  • Python
    def rotl(s): return s[1:] + s[0]
    def a(n): return int(rotl(str(n)))
    print([a(n) for n in range(69)]) # Michael S. Branicky, Jun 09 2021

A255692 Convert n to base 7, move the most significant digit to the least significant one and convert back to base 10.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 1, 8, 15, 22, 29, 36, 43, 2, 9, 16, 23, 30, 37, 44, 3, 10, 17, 24, 31, 38, 45, 4, 11, 18, 25, 32, 39, 46, 5, 12, 19, 26, 33, 40, 47, 6, 13, 20, 27, 34, 41, 48, 1, 8, 15, 22, 29, 36, 43, 50, 57, 64, 71, 78, 85, 92, 99, 106, 113, 120, 127, 134
Offset: 0

Views

Author

Paolo P. Lava, Mar 02 2015

Keywords

Comments

a(7*n) = 1.
Fixed points of the transform are listed in A048332.

Examples

			11 in base 7 is 14: moving the most significant digit as the least significant one we have 41 that is 29 in base 10.
		

Crossrefs

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,7);
  • Mathematica
    roll[n_, b_] := Block[{w = IntegerDigits[n, b]}, Append[Rest@ w, First@ w]]; b = 7; FromDigits[#, b] & /@ (roll[#, b] & /@ Range[0, 68]) (* Michael De Vlieger, Mar 04 2015 *)
    Table[FromDigits[RotateLeft[IntegerDigits[n,7]],7],{n,0,70}] (* Harvey P. Dale, Oct 20 2020 *)

A255690 Convert n to base 5, move the most significant digit to the least significant one and convert back to base 10.

Original entry on oeis.org

0, 1, 2, 3, 4, 1, 6, 11, 16, 21, 2, 7, 12, 17, 22, 3, 8, 13, 18, 23, 4, 9, 14, 19, 24, 1, 6, 11, 16, 21, 26, 31, 36, 41, 46, 51, 56, 61, 66, 71, 76, 81, 86, 91, 96, 101, 106, 111, 116, 121, 2, 7, 12, 17, 22, 27, 32, 37, 42, 47, 52, 57, 62, 67, 72, 77, 82, 87, 92
Offset: 0

Views

Author

Paolo P. Lava, Mar 02 2015

Keywords

Comments

a(5*n) = 1.
Fixed points of the transform are listed in A048330.

Examples

			14 in base 5 is 24: moving the least significant digit as the most significant one we have 42 that is 22 in base 10.
		

Crossrefs

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,5);
  • Mathematica
    roll[n_, b_] := Block[{w = IntegerDigits[n, b]}, Append[Rest@ w, First@ w]]; b = 5; FromDigits[#, b] & /@ (roll[#, b] & /@ Range[0, 68]) (* Michael De Vlieger, Mar 04 2015 *)
Showing 1-3 of 3 results.