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-10 of 23 results. Next

A264979 Bijective base-9 reverse: a(0) = 0; for n >= 1, a(n) = A030108(n/A264981(n)) * A264981(n).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 19, 28, 37, 46, 55, 64, 73, 18, 11, 20, 29, 38, 47, 56, 65, 74, 27, 12, 21, 30, 39, 48, 57, 66, 75, 36, 13, 22, 31, 40, 49, 58, 67, 76, 45, 14, 23, 32, 41, 50, 59, 68, 77, 54, 15, 24, 33, 42, 51, 60, 69, 78, 63, 16, 25, 34, 43, 52, 61, 70, 79, 72, 17, 26, 35, 44, 53, 62, 71, 80, 81
Offset: 0

Views

Author

Antti Karttunen, Dec 07 2015

Keywords

Comments

Self-inverse permutation of nonnegative integers.
It appears that a(m x) == 0 (mod m) for m = 2^k and m = 5*2^k, k >= 0, but not for other m. Is there a simple explanation? - M. F. Hasler, May 21 2021

Crossrefs

Cf. A265338 (a(8n)/8).
Cf. A057889 (base-2), A263273 (base-3), A264994 (base-4), A264995 (base-5).

Programs

Formula

a(0) = 0; for n >= 1, a(n) = A030108(n/A264981(n)) * A264981(n).

A004086 Read n backwards (referred to as R(n) in many sequences).

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, 96, 7, 17, 27, 37, 47
Offset: 0

Views

Author

Keywords

Comments

Also called digit reversal of n.
Leading zeros (after the reversal has taken place) are omitted. - N. J. A. Sloane, Jan 23 2017

Crossrefs

Programs

  • Haskell
    a004086 = read . reverse . show  -- Reinhard Zumkeller, Apr 11 2011
    
  • J
    |.&.": i.@- 1e5 NB. Stephen Makdisi, May 14 2018
  • Maple
    read transforms; A004086 := digrev; #cf "Transforms" link at bottom of page
    A004086:=proc(n) local s,t; if n<10 then n else s:=irem(n,10,'t'); while t>9 do s:=s*10+irem(t,10,'t') od: s*10+t fi end; # M. F. Hasler, Jan 29 2012
  • Mathematica
    Table[FromDigits[Reverse[IntegerDigits[n]]], {n, 0, 75}]
    IntegerReverse[Range[0,80]](* Requires Mathematica version 10 or later *) (* Harvey P. Dale, May 13 2018 *)
  • PARI
    dig(n) = {local(m=n,r=[]); while(m>0,r=concat(m%10,r);m=floor(m/10));r}
    A004086(n) = {local(b,m,r);r=0;b=1;m=dig(n);for(i=1,matsize(m)[2],r=r+b*m[i];b=b*10);r} \\ Michael B. Porter, Oct 16 2009
    
  • PARI
    A004086(n)=fromdigits(Vecrev(digits(n))) \\ M. F. Hasler, Nov 11 2010, updated May 11 2015, Sep 13 2019
    
  • Python
    def A004086(n):
        return int(str(n)[::-1]) # Chai Wah Wu, Aug 30 2014
    

Formula

For n > 0, a(a(n)) = n iff n mod 10 != 0. - Reinhard Zumkeller, Mar 10 2002
a(n) = d(n,0) with d(n,r) = r if n=0, otherwise d(floor(n/10), r*10+(n mod 10)). - Reinhard Zumkeller, Mar 04 2010
a(10*n+x) = x*10^m + a(n) if 10^(m-1) <= n < 10^m and 0 <= x <= 9. - Robert Israel, Jun 11 2015

Extensions

Extended by Ray Chandler, Dec 30 2004

A030102 Base-3 reversal of n (written in base 10).

Original entry on oeis.org

0, 1, 2, 1, 4, 7, 2, 5, 8, 1, 10, 19, 4, 13, 22, 7, 16, 25, 2, 11, 20, 5, 14, 23, 8, 17, 26, 1, 28, 55, 10, 37, 64, 19, 46, 73, 4, 31, 58, 13, 40, 67, 22, 49, 76, 7, 34, 61, 16, 43, 70, 25, 52, 79, 2, 29, 56, 11, 38, 65, 20, 47, 74, 5, 32, 59, 14, 41, 68, 23, 50, 77, 8, 35, 62, 17, 44, 71
Offset: 0

Views

Author

Keywords

Examples

			a(17) = 25 because 17 in base 3 is 122, and backwards that is 221, which is 25 in base 10.
a(18) = 2 because 18 in base 3 is 200, and backwards that is 2.
		

Crossrefs

Cf. A030341.
Cf. A263273 for a bijective variant.

Programs

  • Haskell
    a030102 = foldl (\v d -> 3 * v + d) 0 . a030341_row
    -- Reinhard Zumkeller, Dec 16 2013
  • Maple
    a030102:= proc(n) option remember;
      local y;
      y:= n mod 3;
      3^ilog[3](n)*y + procname((n-y)/3)
    end proc:
    for i from 0 to 2 do a030102(i):= i od:
    seq(a030102(i),i=0..100); # Robert Israel, Dec 24 2015
    # alternative
    A030102 := proc(n)
        local r ;
        r := ListTools[Reverse](convert(n,base,3)) ;
        add(op(i,r)*3^(i-1),i=1..nops(r)) ;
    end proc: # R. J. Mathar, May 28 2016
  • Mathematica
    A030102[n_] := FromDigits[Reverse@IntegerDigits[n, 3], 3] (* JungHwan Min, Dec 23 2015 *)
    FromDigits[#,3]&/@(Reverse/@IntegerDigits[Range[0,80],3]) (* Harvey P. Dale, Feb 05 2020 *)
  • PARI
    a(n,b=3)=subst(Polrev(base(n,b)),x,b) /* where */
    base(n,b)={my(a=[n%b]);while(0M. F. Hasler, Nov 04 2011
    
  • PARI
    a(n) = fromdigits(Vecrev(digits(n, 3)), 3); \\ Michel Marcus, Oct 10 2017
    

Formula

a(n) = t(n,0) with t(n,r) = if n=0 then r else t(floor(n/3),r*3+(n mod 3)). - Reinhard Zumkeller, Mar 04 2010
G.f. G(x) satisfies: G(x) = (1+x+x^2)*G(x^3) - (1+2*x)*(x + 2*Sum_{m>=0} 3^m*x^(3^(m+1)+1)/(x^3-1). - Robert Israel, Dec 24 2015

A255594 Convert n to base 9, move least significant digit to most significant digit and convert back to base 10.

Original entry on oeis.org

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

Views

Author

Paolo P. Lava, Mar 02 2015

Keywords

Comments

Fixed points of the transform are listed in A048334.
For more than 2 base-9 digits, reversal and cyclic shifts of a number start to differ, so this sequence differs from A030108. - Alonso del Arte, Mar 22 2015

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.
		

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 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).

A056960 Base 11 reversal of n (written in base 10).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 12, 23, 34, 45, 56, 67, 78, 89, 100, 111, 2, 13, 24, 35, 46, 57, 68, 79, 90, 101, 112, 3, 14, 25, 36, 47, 58, 69, 80, 91, 102, 113, 4, 15, 26, 37, 48, 59, 70, 81, 92, 103, 114, 5, 16, 27, 38, 49, 60, 71, 82, 93, 104, 115, 6, 17, 28, 39
Offset: 0

Views

Author

Henry Bottomley, Jul 18 2000

Keywords

Crossrefs

Programs

  • Maple
    f:= proc(n) local L,i;
      L:= convert(n,base,11);
      add(L[-i]*11^(i-1),i=1..nops(L))
    end proc:
    map(f, [$0..100]); # Robert Israel, Dec 20 2018
  • Mathematica
    IntegerReverse[Range[0, 100], 11] (* Paolo Xausa, Aug 08 2024 *)
  • PARI
    a(n) = fromdigits(Vecrev(digits(n, 11)), 11); \\ Michel Marcus, Dec 20 2018

A056963 Base 20 reversal of n (written in base 10).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 1, 21, 41, 61, 81, 101, 121, 141, 161, 181, 201, 221, 241, 261, 281, 301, 321, 341, 361, 381, 2, 22, 42, 62, 82, 102, 122, 142, 162, 182, 202, 222, 242, 262, 282, 302, 322, 342, 362, 382, 3, 23, 43
Offset: 0

Views

Author

Henry Bottomley, Jul 18 2000

Keywords

Crossrefs

Programs

  • Mathematica
    IntegerReverse[Range[0, 100], 20] (* Paolo Xausa, Aug 08 2024 *)

A030103 Base 4 reversal of n (written in base 10).

Original entry on oeis.org

0, 1, 2, 3, 1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 15, 1, 17, 33, 49, 5, 21, 37, 53, 9, 25, 41, 57, 13, 29, 45, 61, 2, 18, 34, 50, 6, 22, 38, 54, 10, 26, 42, 58, 14, 30, 46, 62, 3, 19, 35, 51, 7, 23, 39, 55, 11, 27, 43, 59, 15, 31, 47, 63, 1, 65, 129, 193, 17, 81, 145, 209, 33, 97, 161
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Haskell
    import Data.List (unfoldr)
    a030103 n = foldl (\v d -> 4*v + d) 0 $ unfoldr dig n where
        dig x = if x == 0 then Nothing else Just $ swap $ divMod x 4
    -- Reinhard Zumkeller, Oct 10 2011
    
  • Mathematica
    IntegerReverse[Range[0, 100], 4] (* Paolo Xausa, Aug 07 2024 *)
  • PARI
    a(n,b=4)=subst(Polrev(base(n,b)),x,b) /* where */
    base(n,b)={my(a=[n%b]);while(0M. F. Hasler, Nov 04 2011
    (MIT/GNU Scheme)
    (define (A030103 n) (if (zero? n) n (let ((uplim (+ (A000523 n) (- 1 (modulo (A000523 n) 2))))) (add (lambda (i) (* (bit_i n (+ i (expt -1 i))) (expt 2 (- uplim i)))) 0 uplim))))
    (define (bit_i n i) (modulo (floor->exact (/ n (expt 2 i))) 2))
    ;; The functional add implements sum_{i=lowlim..uplim} intfun(i):
    (define (add intfun lowlim uplim) (let sumloop ((i lowlim) (res 0)) (cond ((> i uplim) res) (else (sumloop (1+ i) (+ res (intfun i)))))))
    ;; Antti Karttunen, Oct 30 2013

A030104 Base 5 reversal of n (written in 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, 26, 51, 76, 101, 6, 31, 56, 81, 106, 11, 36, 61, 86, 111, 16, 41, 66, 91, 116, 21, 46, 71, 96, 121, 2, 27, 52, 77, 102, 7, 32, 57, 82, 107, 12, 37, 62, 87, 112, 17, 42, 67, 92, 117, 22, 47, 72, 97
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    IntegerReverse[Range[0, 100], 5] (* Paolo Xausa, Aug 07 2024 *)
  • PARI
    a(n,b=5)=subst(Polrev(base(n,b)),x,b) /* where */
    base(n,b)={my(a=[n%b]);while(n\=b,a=concat(n%b,a));a}  \\ M. F. Hasler, Nov 04 2011

A030107 Base 8 reversal of n (written in base 10).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 1, 9, 17, 25, 33, 41, 49, 57, 2, 10, 18, 26, 34, 42, 50, 58, 3, 11, 19, 27, 35, 43, 51, 59, 4, 12, 20, 28, 36, 44, 52, 60, 5, 13, 21, 29, 37, 45, 53, 61, 6, 14, 22, 30, 38, 46, 54, 62, 7, 15, 23, 31, 39, 47, 55, 63, 1, 65, 129, 193, 257, 321, 385, 449, 9, 73, 137
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Table[FromDigits[Reverse[IntegerDigits[n,8]],8],{n,0,80}] (* Harvey P. Dale, Jun 04 2021 *)
  • PARI
    a(n,b=8)=subst(Polrev(base(n,b)),x,b) /* where */
    base(n,b)={my(a=[n%b]);while(n\=b,a=concat(n%b,a));a}  \\ M. F. Hasler, Nov 04 2011

A030105 Base 6 reversal of n (written in base 10).

Original entry on oeis.org

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, 37, 73, 109, 145, 181, 7, 43, 79, 115, 151, 187, 13, 49, 85, 121, 157, 193, 19, 55, 91, 127, 163, 199, 25, 61, 97, 133, 169, 205, 31, 67, 103, 139, 175
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    Table[FromDigits[Reverse[IntegerDigits[n,6]],6],{n,0,100}] (* Harvey P. Dale, Nov 18 2021 *)
  • PARI
    a(n,b=6)=subst(Polrev(base(n,b)),x,b) /* where */
    base(n,b)={my(a=[n%b]);while(0
    				
Showing 1-10 of 23 results. Next