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-2 of 2 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

A342123 a(n) is the remainder when n is divided by its binary reverse.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 2, 0, 0, 0, 0, 0, 19, 0, 0, 9, 23, 0, 6, 4, 0, 0, 6, 0, 0, 0, 0, 0, 35, 0, 37, 13, 39, 0, 4, 0, 43, 5, 0, 17, 47, 0, 14, 12, 0, 8, 10, 0, 55, 0, 18, 12, 4, 0, 14, 0, 0, 0, 0, 0, 67, 0, 69, 21, 71, 0, 0, 33, 75, 1, 77, 21
Offset: 1

Views

Author

Rémy Sigrist, Feb 28 2021

Keywords

Comments

The binary reverse of a number is given by A030101.
This sequence is the analog of A071955 for the binary base.

Examples

			For n = 43,
- the binary reverse of 43 ("101011" in binary) is 53 ("110101" in binary),
- so a(43) = 43 mod 53 = 43.
		

Crossrefs

Programs

  • PARI
    a(n, base=2) = { my (r=fromdigits(Vecrev(digits(n, base)), base)); n%r }
    
  • Python
    def A342123(n): return n % int(bin(n)[:1:-1],2) if n > 0 else 0 # Chai Wah Wu, Mar 01 2021

Formula

a(n) = n mod A030101(n).
a(n) <= n with equality iff n belongs to A161601.
a(n) = 0 iff n belongs to A057890.
Showing 1-2 of 2 results.