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-8 of 8 results.

A103168 a(n) is the remainder when (n written backwards) is divided by n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 9, 5, 13, 6, 13, 3, 9, 15, 2, 12, 0, 9, 18, 2, 10, 18, 26, 5, 3, 13, 23, 0, 9, 18, 27, 36, 7, 15, 4, 14, 24, 34, 0, 9, 18, 27, 36, 45, 5, 15, 25, 35, 45, 0, 9, 18, 27, 36, 6, 16, 26, 36, 46, 56, 0, 9, 18, 27, 7, 17, 27, 37, 47, 57, 67, 0, 9, 18, 8, 18, 28, 38
Offset: 1

Views

Author

Labos Elemer, Jan 28 2005

Keywords

Examples

			a(n) = 0 for palindromic numbers.
		

Crossrefs

Programs

  • Mathematica
    rd[x_]:=FromDigits[Reverse[IntegerDigits[x]]] Table[Mod[rd[n], n], {n, 1, 256}]
    Table[Mod[IntegerReverse[n],n],{n,90}] (* Harvey P. Dale, Jun 20 2025 *)
  • PARI
    a(n, base=10) = my (r=fromdigits(Vecrev(digits(n, base)), base)); r%n \\ Rémy Sigrist, Apr 05 2020
    
  • Python
    def a(n): return int(str(n)[::-1])%n
    print([a(n) for n in range(1, 84)]) # Michael S. Branicky, Dec 12 2021

Extensions

Definition corrected by N. J. A. Sloane, Jul 14 2007

A161602 Positive integers k that are greater than the value of the reversal of k's binary representation.

Original entry on oeis.org

2, 4, 6, 8, 10, 12, 13, 14, 16, 18, 20, 22, 24, 25, 26, 28, 29, 30, 32, 34, 36, 38, 40, 41, 42, 44, 46, 48, 49, 50, 52, 53, 54, 56, 57, 58, 59, 60, 61, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 81, 82, 84, 86, 88, 89, 90, 92, 94, 96, 97, 98, 100, 101, 102, 104, 105, 106, 108, 109
Offset: 1

Views

Author

Leroy Quet, Jun 14 2009

Keywords

Comments

By "reversal" of k's binary representation, it is meant: write k in binary, reverse the order of its digits, and read the result as a binary value.
This sequence contains all the positive even integers.

Examples

			29 in binary is 11101. Its digital reversal is 10111, which is 23 in decimal. Since 29 > 23, 29 is in this sequence.
		

Crossrefs

Cf. A030101, A006995, A161601, A161603 (odd terms).
Cf. A071590 (using decimal reversal).

Programs

  • Mathematica
    Select[Range[109], # > IntegerReverse[#, 2] &] (* Michael De Vlieger, Apr 07 2021 *)
  • PARI
    isok(k) = k > fromdigits(Vecrev(binary(k)), 2); \\ Michel Marcus, Apr 06 2021
    
  • Python
    from itertools import count, islice
    def A161602_gen(startvalue=1): # generator of terms >= startvalue
        return filter(lambda n:n>int(bin(n)[-1:1:-1],2),count(max(startvalue,1)))
    A161602_list = list(islice(A161602_gen(),20)) # Chai Wah Wu, Jan 19 2023

Extensions

More terms from Max Alekseyev, Sep 11 2009

A071589 Numbers n such that Reversal(n) > n.

Original entry on oeis.org

12, 13, 14, 15, 16, 17, 18, 19, 23, 24, 25, 26, 27, 28, 29, 34, 35, 36, 37, 38, 39, 45, 46, 47, 48, 49, 56, 57, 58, 59, 67, 68, 69, 78, 79, 89, 102, 103, 104, 105, 106, 107, 108, 109, 112, 113, 114, 115, 116, 117, 118, 119, 122, 123, 124, 125, 126, 127, 128, 129
Offset: 1

Views

Author

Benoit Cloitre, Jun 01 2002

Keywords

Crossrefs

Cf. A004086 (digit reversal), A071590 (reversal < n), A002113 (reversal = n).
Cf. A161601 (binary reversal > n).

Programs

  • Mathematica
    Select[Range[200], # < FromDigits[Reverse[IntegerDigits[#]]] &] (* T. D. Noe, Mar 14 2012 *)
  • PARI
    for(i=2,300,n=(i); s=ceil(log(n)/log(10)); if((sum(i=0,s,10^(s-i-1)*(floor(n/10^i*1.)-10*floor(n/10^(i+1)*1.))))>i,print1((i),",")))

A297270 Numbers whose base-10 digits have greater down-variation than up-variation; see Comments.

Original entry on oeis.org

10, 20, 21, 30, 31, 32, 40, 41, 42, 43, 50, 51, 52, 53, 54, 60, 61, 62, 63, 64, 65, 70, 71, 72, 73, 74, 75, 76, 80, 81, 82, 83, 84, 85, 86, 87, 90, 91, 92, 93, 94, 95, 96, 97, 98, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200, 201, 210, 211, 220, 221
Offset: 1

Views

Author

Clark Kimberling, Jan 16 2018

Keywords

Comments

Suppose that n has base-b digits b(m), b(m-1), ..., b(0). The base-b down-variation of n is the sum DV(n,b) of all d(i)-d(i-1) for which d(i) > d(i-1); the base-b up-variation of n is the sum UV(n,b) of all d(k-1)-d(k) for which d(k) < d(k-1). The total base-b variation of n is the sum TV(n,b) = DV(n,b) + UV(n,b). See the guide at A297330.
Differs first from A071590 at 1101, which is in A071590, but not in here because UV(1101) = DV(1101). - R. J. Mathar, Jan 23 2018

Examples

			6151413121 in base-10:  6,1,5,1,4,1,3,1,2,1, having DV = 15, UV = 10, so that 6151413121 is in the sequence.
		

Crossrefs

Programs

  • Mathematica
    g[n_, b_] := Map[Total, GatherBy[Differences[IntegerDigits[n, b]], Sign]];
    x[n_, b_] := Select[g[n, b], # < 0 &]; y[n_, b_] := Select[g[n, b], # > 0 &];
    b = 10; z = 2000; p = Table[x[n, b], {n, 1, z}]; q = Table[y[n, b], {n, 1, z}];
    w = Sign[Flatten[p /. {} -> {0}] + Flatten[q /. {} -> {0}]];
    Take[Flatten[Position[w, -1]], 120]   (* A297270 *)
    Take[Flatten[Position[w, 0]], 120]    (* A297271 *)
    Take[Flatten[Position[w, 1]], 120]    (* A297272 *)

A071955 a(n) = remainder when n is reduced mod reverse(n).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 13, 14, 15, 16, 17, 18, 19, 0, 9, 0, 23, 24, 25, 26, 27, 28, 29, 0, 5, 9, 0, 34, 35, 36, 37, 38, 39, 0, 13, 18, 9, 0, 45, 46, 47, 48, 49, 0, 6, 2, 18, 9, 0, 56, 57, 58, 59, 0, 13, 10, 27, 18, 9, 0, 67, 68, 69, 0, 3, 18, 36, 27, 18, 9, 0, 78, 79, 0, 9
Offset: 1

Views

Author

Joseph L. Pe, Jun 16 2002

Keywords

Comments

a(n)=0 if n is palindromic - Labos Elemer, Jan 28 2005

Examples

			a(85) = 85 mod 58 = 27.
		

Crossrefs

Programs

  • Mathematica
    Table[Mod[n, FromDigits[Reverse[IntegerDigits[n]]]], {n, 1, 256}] (* Labos Elemer, Jan 28 2005 *)
    Table[Mod[n, FromDigits[Reverse[IntegerDigits[n]]]], {n, 1, 100}]
  • PARI
    a(n, base=10) = my (r=fromdigits(Vecrev(digits(n, base)), base)); n%r \\ Rémy Sigrist, Apr 05 2020

Extensions

Edited by N. J. A. Sloane at the suggestion of Andrew S. Plewe, Jul 14 2007

A103167 a(n) = 2^n mod reverse(2^n).

Original entry on oeis.org

0, 0, 0, 16, 9, 18, 128, 256, 82, 1024, 2048, 4096, 2356, 16384, 32768, 1980, 131072, 262144, 524288, 1048576, 2097152, 159390, 319770, 16777216, 10108899, 20228688, 134217728, 268435456, 98713642, 1073741824, 2147483648, 4294967296, 2681134876, 17179869184
Offset: 1

Views

Author

Labos Elemer, Jan 28 2005

Keywords

Comments

Remainder if 2^n is divided by the reverse of 2^n.

Examples

			a(5) = 2^5 mod reverse(2^5) = 32 mod reverse(32) = 32 mod 23 = 9.
		

Crossrefs

Programs

  • Mathematica
    Table[Mod[FromDigits[Reverse[IntegerDigits[2^n]]], 2^n], {n, 1, 256}]
    Table[PowerMod[2,n,IntegerReverse[2^n]],{n,40}] (* Harvey P. Dale, Jan 30 2022 *)
  • Python
    def a(n): t = 2**n; return t%int(str(t)[::-1])
    print([a(n) for n in range(1, 35)]) # Michael S. Branicky, Dec 12 2021

A103166 a(n) = reverse(2^n) mod 2^n.

Original entry on oeis.org

0, 0, 0, 13, 23, 46, 53, 140, 215, 105, 210, 2808, 2918, 15593, 21187, 63556, 7987, 179118, 358137, 466945, 420750, 4034914, 8068838, 10946113, 23445533, 46880176, 22406063, 117663950, 219078635, 1060248229, 2021396468, 2632727628, 2954399858, 13837158803
Offset: 1

Views

Author

Labos Elemer, Jan 28 2005

Keywords

Comments

Remainder if (2^n written backwards) is divided by 2^n.

Examples

			a(4) = reverse(2^4) mod 2^4 = reverse(16) mod 16 = 61 mod 16 = 13.
		

Crossrefs

Programs

  • Mathematica
    Table[Mod[FromDigits[Reverse[IntegerDigits[2^n]]], 2^n], {n, 1, 256}]
  • Python
    def a(n): t = 2**n; return int(str(t)[::-1])%t
    print([a(n) for n in range(1, 35)]) # Michael S. Branicky, Dec 12 2021

A210589 Numbers which, when divided by their first digit, have their last digit as remainder.

Original entry on oeis.org

10, 20, 21, 30, 31, 32, 40, 41, 42, 43, 50, 51, 52, 53, 54, 60, 61, 62, 63, 64, 65, 70, 71, 72, 73, 74, 75, 76, 80, 81, 82, 83, 84, 85, 86, 87, 90, 91, 92, 93, 94, 95, 96, 97, 98, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200, 201, 210, 211, 220, 221, 230, 231, 240, 241
Offset: 1

Views

Author

Eric Angelini (idea) and M. F. Hasler, Mar 23 2012

Keywords

Comments

Coincides with A071590 up to the 79th term, A071590(79)=310 is not in this sequence.
Charles R Greathouse IV observes that this is an automatic sequence in the terminology of Allouche & Shallit.
See A210582 for the obvious "symmetric" counterpart: first digit = x mod last digit. - M. F. Hasler, Jan 14 2014

Programs

  • Magma
    [ n: n in [1..249] | n mod d[#d] eq d[1] where d is Intseq(n) ]; // Bruno Berselli, Mar 23 2012
    
  • Mathematica
    ldrQ[n_]:=Module[{idn=IntegerDigits[n],f,l},f=First[idn];l=Last[idn];Mod[n,f]==l]; Select[Range[10000],ldrQ]  (* Harvey P. Dale, Mar 21 2012 *)
  • PARI
    is_A210589(x)=x%(x\10^(#Str(x)-1))==x%10
    
  • Python
    def ok(n): s = str(n); return n > 0 and n%int(s[0]) == int(s[-1])
    print([k for k in range(242) if ok(k)]) # Michael S. Branicky, Oct 20 2021
Showing 1-8 of 8 results.