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.

Previous Showing 41-50 of 51 results. Next

A164993 a(n) = image of n under the base-3 Kaprekar map n -> (n with digits sorted into descending order) - (n with digits sorted into ascending order).

Original entry on oeis.org

0, 0, 0, 2, 0, 2, 4, 2, 0, 8, 8, 16, 8, 0, 8, 16, 8, 8, 16, 16, 16, 16, 8, 8, 16, 8, 0, 26, 32, 58, 32, 26, 52, 58, 52, 58, 32, 26, 52, 26, 0, 26, 52, 26, 32, 58, 52, 58, 52, 26, 32, 58, 32, 26, 52, 58, 64, 58, 52, 58, 64, 58, 52, 58, 52, 58, 52, 26, 32, 58, 32, 26, 64, 58, 52, 58, 32
Offset: 0

Views

Author

Joseph Myers, Sep 04 2009

Keywords

Examples

			For n = 10, 10_10 = 101_3. So, a(10) = 110_3 - 11_3 = 12 - 4 = 8. - _Indranil Ghosh_, Feb 02 2017
		

Crossrefs

Cf. A164994.
In other bases: A164884 (base 2), A165012 (base 4), A165032 (base 5), A165051 (base 6), A165071 (base 7), A165090 (base 8), A165110 (base 9), A151949 (base 10).

Programs

  • Mathematica
    a[n_] := With[{dd = IntegerDigits[n, 3]}, FromDigits[ReverseSort[dd], 3] - FromDigits[Sort[dd], 3]];
    a /@ Range[0, 100] (* Jean-François Alcover, Jan 08 2020 *)

A056965 a(n) = n - (reversal of digits of n).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, -9, -18, -27, -36, -45, -54, -63, -72, 18, 9, 0, -9, -18, -27, -36, -45, -54, -63, 27, 18, 9, 0, -9, -18, -27, -36, -45, -54, 36, 27, 18, 9, 0, -9, -18, -27, -36, -45, 45, 36, 27, 18, 9, 0, -9, -18, -27, -36, 54, 45, 36, 27, 18, 9, 0, -9, -18, -27, 63, 54, 45, 36, 27, 18, 9, 0, -9, -18, 72, 63, 54
Offset: 0

Views

Author

Henry Bottomley, Jul 18 2000

Keywords

Comments

a(n) is a multiple of 9.

Examples

			a(17) = 17 - 71 = -54.
		

Crossrefs

Programs

  • Haskell
    a056965 n = n - a004086 n  -- Reinhard Zumkeller, Sep 17 2013
    
  • Maple
    a:= n-> (s-> n-parse(cat(s[-i]$i=1..length(s))))(""||n):
    seq(a(n), n=0..82);  # Alois P. Heinz, Jul 11 2021
  • Mathematica
    Table[n - FromDigits[Reverse[IntegerDigits[n]]], {n, 0, 82}] (* Jayanta Basu, Jul 11 2013 *)
  • PARI
    a(n) = n - fromdigits(Vecrev(digits(n))); \\ Michel Marcus, Dec 20 2023
  • Python
    def a(n): return n - int(str(n)[::-1]) # Osman Mustafa Quddusi, Jul 11 2021
    

Formula

a(n) = n - A004086(n) = 2*n - A056964(n).

A164884 a(n) = image of n under the base-2 Kaprekar map n -> (n with digits sorted into descending order) - (n with digits sorted into ascending order).

Original entry on oeis.org

0, 0, 1, 0, 3, 3, 3, 0, 7, 9, 9, 7, 9, 7, 7, 0, 15, 21, 21, 21, 21, 21, 21, 15, 21, 21, 21, 15, 21, 15, 15, 0, 31, 45, 45, 49, 45, 49, 49, 45, 45, 49, 49, 45, 49, 45, 45, 31, 45, 49, 49, 45, 49, 45, 45, 31, 49, 45, 45, 31, 45, 31, 31, 0, 63, 93, 93, 105, 93, 105, 105, 105, 93, 105, 105
Offset: 0

Views

Author

Joseph Myers, Aug 29 2009

Keywords

Examples

			For n = 17, 17_10 = 10001_2. So, a(17) = 11000_2 - 11_2 = 24 - 3 = 21. - _Indranil Ghosh_, Feb 01 2017
		

Crossrefs

In other bases: A164993 (base 3), A165012 (base 4), A165032 (base 5), A165051 (base 6), A165071 (base 7), A165090 (base 8), A165110 (base 9), A151949 (base 10).

Programs

  • Mathematica
    a[n_] := With[{dd = IntegerDigits[n, 2]}, FromDigits[ReverseSort[dd], 2] - FromDigits[Sort[dd], 2]];
    a /@ Range[0, 100] (* Jean-François Alcover, Jan 08 2020 *)
  • Python
    def A164884(n):
        return int("".join(sorted(bin(n)[2:],reverse=True)),2)-int("".join(sorted(bin(n)[2:])),2) # Indranil Ghosh, Feb 01 2017

Extensions

Cross-references edited by Joseph Myers, Sep 04 2009

A164715 Length of cycle mentioned in A099010.

Original entry on oeis.org

2, 2, 4, 4, 4, 4, 4, 4, 4, 4, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 7, 3, 7, 7, 3, 7, 7, 7, 7, 3, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 7, 3, 3, 7, 3, 7, 3, 3, 7, 7, 7, 7, 3, 3, 3, 3, 3, 3, 3, 8, 8, 5, 5, 8, 8, 8, 5, 5, 8, 8, 5, 8, 7, 3, 3, 3, 7, 3, 3, 3, 7, 3, 3, 3, 7, 7, 7, 7, 3
Offset: 1

Views

Author

Joseph Myers, Aug 23 2009

Keywords

Crossrefs

In other bases: Empty (base 2), A165001 (base 3), A165020 (base 4), A165040 (base 5), A165059 (base 6), A165079 (base 7), A165098 (base 8), A165118 (base 9). [From Joseph Myers, Sep 05 2009]

A164717 Length of cycle mentioned in A164716.

Original entry on oeis.org

1, 1, 1, 2, 2, 4, 4, 4, 4, 4, 4, 4, 4, 7, 1, 1, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 7, 1, 3, 7, 7, 3, 7, 7, 7, 7, 3, 1, 1, 14, 14, 14, 14, 14, 1, 14, 14, 14, 14, 14, 14, 14, 14, 14, 7, 1, 3, 3, 7, 3, 7, 3, 3, 7, 7, 7, 7, 3, 3, 3, 3, 3, 1, 3, 3, 1, 8, 8, 5, 1, 5, 8, 8, 8, 5, 5, 8, 8, 5, 8, 7, 1, 1, 3
Offset: 1

Views

Author

Joseph Myers, Aug 23 2009

Keywords

Crossrefs

In other bases: A000012 (base 2), A164999 (base 3), A165018 (base 4), A165038 (base 5), A165057 (base 6), A165077 (base 7), A165096 (base 8), A165116 (base 9). [From Joseph Myers, Sep 05 2009]

A164719 Length of cycle mentioned in A164718.

Original entry on oeis.org

1, 1, 1, 2, 4, 4, 7, 1, 1, 8, 7, 1, 3, 1, 1, 14, 1, 7, 1, 3, 3, 3, 3, 1, 1, 8, 5, 1, 7, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 1, 3, 3, 1, 1, 5, 1, 5, 2, 5, 7, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 3, 3, 3, 1, 3, 3, 1, 3, 3, 1, 1, 1, 5, 1, 5, 2, 5, 5, 5, 7, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3
Offset: 1

Views

Author

Joseph Myers, Aug 23 2009

Keywords

Crossrefs

In other bases: A000012 (base 2), A165003 (base 3), A165022 (base 4), A165042 (base 5), A165061 (base 6), A165081 (base 7), A165100 (base 8), A165120 (base 9). [From Joseph Myers, Sep 05 2009]

A164721 Length of cycle mentioned in A164720.

Original entry on oeis.org

2, 4, 4, 7, 8, 7, 3, 14, 7, 3, 3, 3, 3, 8, 5, 7, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 5, 2, 5, 7, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 5, 2, 5, 5, 5, 7, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 5, 2, 5, 5, 5, 5, 7, 3, 3
Offset: 1

Views

Author

Joseph Myers, Aug 23 2009

Keywords

Crossrefs

In other bases: Empty (base 2), A165005 (base 3), A165024 (base 4), A165044 (base 5), A165063 (base 6), A165083 (base 7), A165102 (base 8), A165122 (base 9). [From Joseph Myers, Sep 05 2009]

A227362 Distinct digits of n arranged in decreasing order.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 21, 31, 41, 51, 61, 71, 81, 91, 20, 21, 2, 32, 42, 52, 62, 72, 82, 92, 30, 31, 32, 3, 43, 53, 63, 73, 83, 93, 40, 41, 42, 43, 4, 54, 64, 74, 84, 94, 50, 51, 52, 53, 54, 5, 65, 75, 85, 95, 60, 61, 62, 63, 64, 65, 6, 76, 86
Offset: 0

Views

Author

Reinhard Zumkeller, Jul 09 2013

Keywords

Comments

a(n) <= 9876543210; a(a(n)) = a(n);
A055642(a(n)) <= 10;
A055642(a(n)) <= A055642(n), A055642(a(n)) = A055642(n) iff A178788(n) = 1;
a(A109303(n)) < A109303(n); a(A009995(n)) = A009995(n); a(A071589(n)) > A071589(n);
a(n) = A151949(n) + A180410(n).

Crossrefs

Programs

  • Haskell
    import Data.List (nub, sort)
    a227362 = read . reverse . sort . nub . show :: Integer -> Integer
    
  • Maple
    a:= n-> parse(cat(sort([{convert(n, base, 10)[]}[]], `>`)[])):
    seq(a(n), n=0..68);  # Alois P. Heinz, Sep 21 2022
  • Mathematica
    f[n_] := FromDigits[Reverse@ Union@ IntegerDigits@ n]; f /@ Range[0, 68] (* Michael De Vlieger, Apr 16 2015, corrected by Robert G. Wilson v *)
  • PARI
    a(n) = {if (n == 0, d = [0], d = digits(n)); eval(subst(Pol(vecsort(d,,12)), x, 10));} \\ Michel Marcus, Apr 16 2015
    
  • PARI
    a(n)=fromdigits(vecsort(digits(n),,12)) \\ Charles R Greathouse IV, Apr 16 2015
    
  • Python
    def A227362(n): return int(''.join(sorted(set(str(n)),reverse=True))) # Chai Wah Wu, Nov 23 2022

A180410 Unique digits used in n in numerical order.

Original entry on oeis.org

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

Views

Author

Dominick Cancilla, Sep 02 2010

Keywords

Comments

a(n) = A227362(n) - A151949(n). - Reinhard Zumkeller, Jul 09 2013

Examples

			a(93077) = 0379 = 379. Seven is only used once and the digits are sorted. The initial zero is not shown.
		

Crossrefs

This is identical to A180409 with the zeros removed.

Programs

  • Haskell
    import Data.List (nub, sort)
    a180410 = read . sort . nub . show :: Integer -> Integer
    -- Reinhard Zumkeller, Jul 09 2013
  • Maple
    a:= n-> parse(cat(sort([{convert(n, base, 10)[]}[]])[])):
    seq(a(n), n=1..70);  # Alois P. Heinz, Sep 21 2022

Formula

a(n) = 0123456789 after any digits not appearing in n are removed.

A108782 Difference between n and the largest number with the same digit set as n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 18, 27, 36, 45, 54, 63, 72, 0, 0, 0, 9, 18, 27, 36, 45, 54, 63, 0, 0, 0, 0, 9, 18, 27, 36, 45, 54, 0, 0, 0, 0, 0, 9, 18, 27, 36, 45, 0, 0, 0, 0, 0, 0, 9, 18, 27, 36, 0, 0, 0, 0, 0, 0, 0, 9, 18, 27, 0, 0, 0, 0, 0, 0, 0, 0, 9, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0
Offset: 0

Views

Author

Zak Seidov, Jun 29 2005

Keywords

Crossrefs

Programs

  • Mathematica
    FromDigits[Sort[IntegerDigits[n], Greater]] - n (Rob Pratt)
    Table[Max[FromDigits/@ Permutations[IntegerDigits[n]]]-n, {n, 150}]

Formula

a(n) = A004186(n) - n. - Seiichi Manyama, Sep 25 2018

Extensions

a(0)=0 prepended by Seiichi Manyama, Sep 25 2018
Previous Showing 41-50 of 51 results. Next