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.

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 *)

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

A165108 Smallest member of cycle corresponding to n-th term of A165107.

Original entry on oeis.org

0, 21, 252, 1589, 1022, 21483, 17892, 213402, 102837, 147420, 1445787, 1707930, 1711962, 13667738, 16092433, 6589877, 110132442, 111443346, 93093147, 76545756, 878996762, 1029991697, 874802586, 421817781, 1068263553
Offset: 1

Views

Author

Joseph Myers, Sep 04 2009

Keywords

Comments

Initial terms in base 8: 0, 25, 374, 3065, 1776, 51753, 42744, 640632, 310665, 437734.

Crossrefs

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

A165109 Length of cycle corresponding to n-th term of A165107.

Original entry on oeis.org

1, 1, 1, 3, 5, 4, 2, 1, 3, 1, 7, 4, 1, 3, 1, 3, 5, 4, 5, 1, 3, 3, 3, 3, 1, 6, 4, 2, 3, 3, 3, 3, 3, 1, 4, 2, 3, 3, 1, 1, 1, 9, 5, 3, 3, 1, 3, 3, 1, 3, 3, 3, 3, 3, 3, 3, 3, 1, 1, 12, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 3, 5, 1, 2, 1, 3, 3, 3, 6, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
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), A165129 (base 9), A151966 (base 10).

A165096 Length of cycle mentioned in A165095.

Original entry on oeis.org

1, 1, 1, 5, 3, 5, 5, 3, 5, 3, 5, 2, 2, 4, 4, 4, 4, 3, 1, 3, 1, 3, 7, 7, 7, 4, 1, 7, 4, 7, 7, 7, 4, 4, 3, 3, 3, 3, 3, 3, 1, 1, 5, 5, 4, 4, 5, 5, 5, 5, 5, 4, 4, 5, 5, 5, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 6, 4, 6, 4, 2, 6, 6, 4, 2, 4, 6, 6, 3, 1, 3, 3, 3, 3, 3, 3, 4, 1, 3, 2, 3, 3, 3, 3, 1, 4, 4, 3, 3, 3, 4, 2
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), A165116 (base 9), A164717 (base 10).

A165098 Length of cycle mentioned in A165097.

Original entry on oeis.org

5, 3, 5, 5, 3, 5, 3, 5, 2, 2, 4, 4, 4, 4, 3, 3, 3, 7, 7, 7, 4, 7, 4, 7, 7, 7, 4, 4, 3, 3, 3, 3, 3, 3, 5, 5, 4, 4, 5, 5, 5, 5, 5, 4, 4, 5, 5, 5, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 6, 4, 6, 4, 2, 6, 6, 4, 2, 4, 6, 6, 3, 3, 3, 3, 3, 3, 3, 4, 3, 2, 3, 3, 3, 3, 4, 4, 3, 3, 3, 4, 2, 3, 3, 3, 3, 3, 3, 5, 9, 9, 9, 5, 5
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), A165118 (base 9), A164715 (base 10).

A165100 Length of cycle mentioned in A165099.

Original entry on oeis.org

1, 1, 1, 5, 3, 2, 4, 3, 1, 1, 7, 4, 1, 3, 3, 1, 1, 5, 5, 4, 3, 3, 3, 3, 1, 6, 4, 2, 3, 1, 3, 3, 3, 4, 1, 2, 1, 3, 3, 3, 1, 5, 9, 3, 3, 3, 3, 3, 3, 1, 1, 3, 3, 3, 1, 3, 3, 3, 1, 1, 12, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 3, 3, 3, 1, 2, 5, 1, 3, 1, 3, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 6, 2, 3, 3, 3
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), A165120 (base 9), A164719 (base 10).

A165102 Length of cycle mentioned in A165101.

Original entry on oeis.org

5, 3, 2, 4, 3, 7, 4, 3, 3, 5, 5, 4, 3, 3, 3, 3, 6, 4, 2, 3, 3, 3, 3, 4, 2, 3, 3, 3, 5, 9, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 12, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 5, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 6, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
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), A165122 (base 9), A164721 (base 10).

A319656 Write n in 8-ary, sort digits into increasing order.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 1, 9, 10, 11, 12, 13, 14, 15, 2, 10, 18, 19, 20, 21, 22, 23, 3, 11, 19, 27, 28, 29, 30, 31, 4, 12, 20, 28, 36, 37, 38, 39, 5, 13, 21, 29, 37, 45, 46, 47, 6, 14, 22, 30, 38, 46, 54, 55, 7, 15, 23, 31, 39, 47, 55, 63, 1, 9, 10, 11, 12, 13, 14
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), this sequence (b=8), A319657 (b=9), A004185 (b=10).
Cf. A165090.

Programs

  • Maple
    a:= n-> (l-> add(l[-i]*8^(i-1), i=1..nops(l)))(sort(convert(n, base, 8))):
    seq(a(n), n=0..70);  # Alois P. Heinz, Aug 07 2024
  • Mathematica
    Table[FromDigits[Sort[IntegerDigits[n, 8]], 8], {n, 0, 100}] (* Paolo Xausa, Aug 07 2024 *)
  • PARI
    a(n) = fromdigits(vecsort(digits(n, 8)), 8); \\ 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(8, 100)
    

A319725 Write n in 8-ary, sort digits into decreasing order.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 17, 25, 33, 41, 49, 57, 16, 17, 18, 26, 34, 42, 50, 58, 24, 25, 26, 27, 35, 43, 51, 59, 32, 33, 34, 35, 36, 44, 52, 60, 40, 41, 42, 43, 44, 45, 53, 61, 48, 49, 50, 51, 52, 53, 54, 62, 56, 57, 58, 59, 60, 61, 62, 63, 64, 72, 136, 200, 264
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), this sequence (b=8), A319726 (b=9), A004186 (b=10).

Programs

  • Mathematica
    Table[FromDigits[ReverseSort[IntegerDigits[n, 8]], 8], {n, 0, 100}] (* Paolo Xausa, Aug 07 2024 *)
  • PARI
    a(n) = fromdigits(vecsort(digits(n, 8), , 4), 8); \\ 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(8, 100)
    

Formula

n <= a(n) < 8n. - Charles R Greathouse IV, Aug 07 2024
Previous Showing 21-30 of 30 results.