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.

A068636 a(n) = Min(n, R(n)), where R(n) (A004086) = digit reversal of n.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2, 12, 22, 23, 24, 25, 26, 27, 28, 29, 3, 13, 23, 33, 34, 35, 36, 37, 38, 39, 4, 14, 24, 34, 44, 45, 46, 47, 48, 49, 5, 15, 25, 35, 45, 55, 56, 57, 58, 59, 6, 16, 26, 36, 46, 56, 66, 67, 68, 69, 7, 17, 27, 37, 47, 57
Offset: 1

Views

Author

Amarnath Murthy, Feb 27 2002

Keywords

Comments

a(n) = A004185(n) for n <= 100. - Reinhard Zumkeller, Apr 03 2015

Examples

			a(12) = min(12,21) = 12. a(34632) = min(34632,23643) = 23643.
		

Crossrefs

Programs

  • Haskell
    a068636 n = min n $ a004086 n  -- Reinhard Zumkeller, Apr 03 2015
    
  • Maple
    a:= n-> min(n,(s-> parse(cat(seq(s[-i], i=1..length(s)))))(""||n)):
    seq(a(n), n=1..100);  # Alois P. Heinz, Aug 22 2015
  • Mathematica
    Table[Min[n,IntegerReverse[n]],{n,80}] (* The program uses the IntegerReverse function from Mathematica version 10 *) (* Harvey P. Dale, Nov 27 2015 *)
  • Python
    def A068636(n): return min(n,int(str(n)[::-1])) # Chai Wah Wu, Jun 26 2025

A325402 maxflip(n) = max(n, r(n)) where r(n) is the binary reverse of n.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 13, 12, 13, 14, 15, 16, 17, 18, 25, 20, 21, 22, 29, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 49, 36, 41, 38, 57, 40, 41, 42, 53, 44, 45, 46, 61, 48, 49, 50, 51, 52, 53, 54, 59, 56, 57, 58, 59, 60, 61, 62, 63
Offset: 0

Views

Author

Francois Alcover, Apr 23 2019

Keywords

Examples

			a(10) = max(10, r(10))
      = max(10, b'0101')
      = max(10, 5)
      = 10.
a(11) = max(11, r(11))
      = max(11, b'1101')
      = max(11, 13)
      = 13.
		

Crossrefs

Cf. A068637 (analog in base 10).

Programs

  • Maple
    a:= proc(n) local m, r; m:=n; r:=0;
          while m>0 do r:=r*2+irem(m, 2, 'm') od;
          max(n, r)
        end:
    seq(a(n), n=0..127);  # Alois P. Heinz, Apr 23 2019
  • PARI
    a(n) = max(n, fromdigits(Vecrev(binary(n)), 2)); \\ Michel Marcus, Apr 24 2019

Formula

a(n) = max(n,A030101(n)).

A061649 Smallest absolute value of a remainder when the larger of n and its reverse is divided by the smaller.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 5, 1, 6, 3, 3, 9, 4, 0, 3, 0, 9, 6, 2, 10, 9, 2, 5, 0, 5, 9, 0, 9, 17, 9, 1, 7, 15, 0, 1, 6, 9, 0, 9, 18, 20, 12, 4, 0, 6, 2, 17, 9, 0, 9, 18, 27, 23, 0, 3, 10, 9, 18, 9, 0, 9, 18, 27, 0, 3, 9, 1, 20, 18, 9, 0, 9, 18, 0, 9, 2, 7, 12, 27, 18, 9, 0, 9, 0, 4, 5, 15
Offset: 0

Views

Author

Erich Friedman, Jun 16 2001

Keywords

Examples

			a(12)=3 since 21/12 = 2 with remainder -3.
		

Crossrefs

Cf. A068637 (Max(n, R(n))).

Programs

  • Mathematica
    lnrs[n_]:=Module[{a,b,m},{a,b}=Sort[{n,IntegerReverse[n]}];m=Mod[b,a];Min[ m,a-m]]; Join[{0},Array[lnrs,100]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Oct 10 2017 *)
  • PARI
    { for (n=0, 1000, x=n; r=0; while (x>0, d=x-10*(x\10); x\=10; r=r*10 + d); m=min(n, r); a=max(n, r)%m; write("b061649.txt", n, " ", min(a, m-a)) ) } \\ Harry J. Smith, Jul 25 2009
Showing 1-3 of 3 results.