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 21-30 of 30 results.

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

A165128 Smallest member of cycle corresponding to n-th term of A165127.

Original entry on oeis.org

0, 16, 320, 2256, 3712, 34960, 41520, 183696, 3496800, 31596672, 31531872, 278474880, 326952560, 2066242576, 2516902752, 2598744000, 26531651360, 23087388720, 167365651216, 203869268832, 211282856832, 2184410558000
Offset: 1

Views

Author

Joseph Myers, Sep 04 2009

Keywords

Comments

Initial terms in base 9: 0, 17, 385, 3076, 5074, 52854, 62853, 308876, 6518633, 65407433.

Crossrefs

In other bases: A163205 (base 2), A165010 (base 3), A165030 (base 4), A165049 (base 5), A165069 (base 6), A165088 (base 7), A165108 (base 8), A151965 (base 10).

A165129 Length of cycle corresponding to n-th term of A165127.

Original entry on oeis.org

1, 2, 2, 3, 3, 5, 1, 14, 2, 4, 1, 12, 1, 5, 4, 1, 6, 1, 6, 2, 2, 4, 6, 1, 11, 1, 1, 3, 4, 6, 1, 2, 1, 7, 1, 2, 1, 9, 6, 1, 1, 4, 4, 1, 1, 1, 15, 6, 1, 1, 6, 4, 7, 4, 1, 1, 10, 2, 2, 2, 1, 8, 3, 2, 7, 4, 1, 1, 1, 1, 2, 6, 1, 1, 3, 2, 6, 4, 6, 7, 3, 2, 8, 3, 7, 4, 1, 1, 1, 2, 13, 1, 1, 20, 4, 5, 1, 2, 3, 6, 2, 8
Offset: 1

Views

Author

Joseph Myers, Sep 04 2009

Keywords

Crossrefs

In other bases: A000012 (base 2), A165011 (base 3), A165031 (base 4), A165050 (base 5), A165070 (base 6), A165089 (base 7), A165109 (base 8), A151966 (base 10).

A165116 Length of cycle mentioned in A165115.

Original entry on oeis.org

1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 5, 5, 1, 5, 5, 5, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 2, 2, 1, 4, 4, 4, 4, 12, 12, 12, 1, 12, 12, 12, 12, 12, 12, 12, 12, 12, 5, 5, 4, 5, 5, 1, 4, 4, 5, 4, 1, 6, 6, 6, 6, 6, 6, 6, 6, 2, 6, 6, 2, 6, 2, 2, 6, 1, 6, 6, 4, 6, 4, 6, 4, 6, 4, 6, 11, 11
Offset: 1

Views

Author

Joseph Myers, Sep 04 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), A164717 (base 10).

A165118 Length of cycle mentioned in A165117.

Original entry on oeis.org

2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 5, 5, 5, 5, 5, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 2, 2, 4, 4, 4, 4, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 5, 5, 4, 5, 5, 4, 4, 5, 4, 6, 6, 6, 6, 6, 6, 6, 6, 2, 6, 6, 2, 6, 2, 2, 6, 6, 6, 4, 6, 4, 6, 4, 6, 4, 6, 11, 11, 11, 11, 11, 11, 11
Offset: 1

Views

Author

Joseph Myers, Sep 04 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), A164715 (base 10).

A165120 Length of cycle mentioned in A165119.

Original entry on oeis.org

1, 2, 2, 3, 3, 5, 1, 14, 2, 1, 4, 12, 1, 5, 4, 1, 1, 6, 6, 2, 2, 1, 6, 4, 11, 1, 1, 1, 3, 6, 4, 2, 1, 1, 2, 7, 1, 6, 9, 1, 1, 1, 4, 1, 4, 1, 6, 15, 1, 1, 1, 4, 6, 7, 4, 1, 10, 1, 2, 2, 2, 1, 1, 1, 8, 3, 2, 7, 4, 1, 6, 1, 2, 1, 1, 1, 7, 4, 6, 3, 6, 3, 2, 8, 3, 2, 7, 4, 1, 13, 1, 1, 2, 1, 2, 20, 1, 5, 4, 6, 3, 2
Offset: 1

Views

Author

Joseph Myers, Sep 04 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), A164719 (base 10).

A165122 Length of cycle mentioned in A165121.

Original entry on oeis.org

2, 2, 3, 3, 5, 14, 2, 4, 12, 5, 4, 6, 6, 2, 2, 6, 4, 11, 3, 6, 4, 2, 2, 7, 6, 9, 4, 4, 6, 15, 4, 6, 7, 4, 10, 2, 2, 2, 8, 3, 2, 7, 4, 6, 2, 7, 4, 6, 3, 6, 3, 2, 8, 3, 2, 7, 4, 13, 2, 2, 20, 5, 4, 6, 3, 2, 8, 3, 2, 7, 4, 31, 6, 3, 7, 5, 8, 5, 4, 6, 3, 2, 8, 3, 2, 7, 4, 7, 22, 7, 3, 8, 5, 7, 5, 8, 5, 4, 6, 3, 2
Offset: 1

Views

Author

Joseph Myers, Sep 04 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), A164721 (base 10).

A319657 Write n in 9-ary, sort digits into increasing order.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 1, 10, 11, 12, 13, 14, 15, 16, 17, 2, 11, 20, 21, 22, 23, 24, 25, 26, 3, 12, 21, 30, 31, 32, 33, 34, 35, 4, 13, 22, 31, 40, 41, 42, 43, 44, 5, 14, 23, 32, 41, 50, 51, 52, 53, 6, 15, 24, 33, 42, 51, 60, 61, 62, 7, 16, 25, 34, 43, 52, 61, 70, 71
Offset: 0

Views

Author

Seiichi Manyama, Sep 25 2018

Keywords

Crossrefs

b-ary: A038573 (b=2), A038574 (b=3), A319652 (b=4), A319653 (b=5), A319654 (b=6), A319655 (b=7), A319656 (b=8), this sequence (b=9), A004185 (b=10).
Cf. A165110.

Programs

  • Maple
    a:= n-> (l-> add(l[-i]*9^(i-1), i=1..nops(l)))(sort(convert(n, base, 9))):
    seq(a(n), n=0..71);  # Alois P. Heinz, Aug 07 2024
  • Mathematica
    Table[FromDigits[Sort[IntegerDigits[n, 9]], 9], {n, 0, 100}] (* Paolo Xausa, Aug 07 2024 *)
  • PARI
    a(n) = fromdigits(vecsort(digits(n, 9)), 9); \\ Michel Marcus, Sep 25 2018
  • Ruby
    def A(k, n)
      (0..n).map{|i| i.to_s(k).split('').sort.join.to_i(k)}
    end
    p A(9, 100)
    

A319726 Write n in 9-ary, sort digits into decreasing order.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 19, 28, 37, 46, 55, 64, 73, 18, 19, 20, 29, 38, 47, 56, 65, 74, 27, 28, 29, 30, 39, 48, 57, 66, 75, 36, 37, 38, 39, 40, 49, 58, 67, 76, 45, 46, 47, 48, 49, 50, 59, 68, 77, 54, 55, 56, 57, 58, 59, 60, 69, 78, 63, 64, 65, 66, 67, 68, 69
Offset: 0

Views

Author

Seiichi Manyama, Sep 26 2018

Keywords

Crossrefs

b-ary: A073138 (b=2), A319651 (b=3), A319720 (b=4), A319722 (b=5), A319723 (b=6), A319724 (b=7), A319725 (b=8), this sequence (b=9), A004186 (b=10).

Programs

  • Mathematica
    Table[FromDigits[Reverse[Sort[IntegerDigits[n,9]]],9],{n,0,70}] (* Harvey P. Dale, Oct 26 2022 *)
  • PARI
    a(n) = fromdigits(vecsort(digits(n, 9), , 4), 9); \\ Michel Marcus, Sep 26 2018
  • Ruby
    def A(k, n)
      (0..n).map{|i| i.to_s(k).split('').sort.reverse.join.to_i(k)}
    end
    p A(9, 100)
    

Formula

n <= a(n) < 9n. - Charles R Greathouse IV, Aug 07 2024

A319747 a(n) = A319726(n) + A319657(n).

Original entry on oeis.org

0, 2, 4, 6, 8, 10, 12, 14, 16, 10, 20, 30, 40, 50, 60, 70, 80, 90, 20, 30, 40, 50, 60, 70, 80, 90, 100, 30, 40, 50, 60, 70, 80, 90, 100, 110, 40, 50, 60, 70, 80, 90, 100, 110, 120, 50, 60, 70, 80, 90, 100, 110, 120, 130, 60, 70, 80, 90, 100, 110, 120, 130, 140, 70
Offset: 0

Views

Author

Seiichi Manyama, Sep 27 2018

Keywords

Comments

This sequence is different from A055958. For example, A055958(82) = 164 and a(82) = 100.

Crossrefs

Base b: A319785 (b=2), this sequence (b=9), A052008 (b=10).

Programs

  • Mathematica
    Table[FromDigits[Reverse[#], 9] + FromDigits[#, 9] & [Sort[IntegerDigits[n, 9]]], {n, 0, 100}] (* Paolo Xausa, Aug 08 2024 *)
  • PARI
    a(n) = my(dn=digits(n, 9)); fromdigits(vecsort(dn), 9) + fromdigits(vecsort(dn,,4), 9); \\ Michel Marcus, Sep 28 2018
Previous Showing 21-30 of 30 results.