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

A165010 Smallest member of cycle corresponding to n-th term of A165009.

Original entry on oeis.org

0, 32, 184, 320, 1696, 2008, 5332, 15304, 18208, 19144, 26240, 55360, 137776, 164008, 146488, 172720, 175528, 433012, 520372, 1240024, 1476208, 1554904, 1502344, 1581040, 1589464, 3975844, 4487680, 4749760, 11160256, 13286008
Offset: 1

Views

Author

Joseph Myers, Sep 04 2009

Keywords

Comments

Initial terms in base 3: 0, 1012, 20211, 102212, 2022211, 2202101, 21022111, 202222211, 220222101, 222021001.

Crossrefs

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

A165011 Length of cycle corresponding to n-th term of A165009.

Original entry on oeis.org

1, 2, 1, 3, 2, 1, 1, 3, 2, 1, 4, 1, 3, 3, 1, 2, 1, 2, 1, 5, 3, 3, 1, 2, 1, 1, 2, 1, 6, 5, 3, 3, 1, 2, 1, 3, 1, 2, 1, 4, 6, 2, 5, 3, 1, 3, 1, 2, 1, 5, 3, 1, 2, 1, 4, 4, 4, 6, 2, 5, 3, 1, 3, 1, 2, 1, 3, 1, 3, 1, 2, 1, 9, 4, 4, 4, 6, 2, 5, 3, 1, 3, 1, 2, 1, 2, 3, 1, 3, 1, 2, 1, 6, 9, 3, 4, 4, 4, 6, 2, 5, 1, 3, 1, 3
Offset: 1

Views

Author

Joseph Myers, Sep 04 2009

Keywords

Crossrefs

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

A164999 Length of cycle mentioned in A164998.

Original entry on oeis.org

1, 2, 2, 1, 3, 3, 3, 2, 2, 1, 1, 3, 3, 3, 2, 2, 1, 4, 4, 4, 4, 1, 3, 3, 1, 3, 3, 3, 3, 2, 2, 1, 2, 2, 1, 5, 5, 5, 5, 5, 3, 3, 1, 3, 3, 3, 3, 2, 2, 1, 1, 2, 2, 1, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 3, 3, 1, 3, 3, 3, 3, 2, 2, 1, 3, 3, 3, 1, 2, 2, 1, 4, 4, 2, 4, 1, 2, 4, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 3, 3, 1, 3, 3
Offset: 1

Views

Author

Joseph Myers, Sep 04 2009

Keywords

Crossrefs

In other bases: A000012 (base 2), A165018 (base 4), A165038 (base 5), A165057 (base 6), A165077 (base 7), A165096 (base 8), A165116 (base 9), A164717 (base 10).

A165001 Length of cycle mentioned in A165000.

Original entry on oeis.org

2, 2, 3, 3, 3, 2, 2, 3, 3, 3, 2, 2, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 5, 5, 5, 5, 5, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 3, 3, 3, 3, 3, 3, 2, 2, 3, 3, 3, 2, 2, 4, 4, 2, 4, 2, 4, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 3, 3, 3, 3, 3, 3, 2, 2, 5, 5, 5, 5, 5, 3, 3, 3, 2, 2, 4, 4, 4, 4, 4
Offset: 1

Views

Author

Joseph Myers, Sep 04 2009

Keywords

Crossrefs

In other bases: Empty (base 2), A165020 (base 4), A165040 (base 5), A165059 (base 6), A165079 (base 7), A165098 (base 8), A165118 (base 9), A164715 (base 10).

A165003 Length of cycle mentioned in A165002.

Original entry on oeis.org

1, 2, 1, 3, 2, 1, 1, 3, 2, 1, 4, 1, 3, 1, 3, 2, 1, 2, 1, 5, 3, 1, 3, 2, 1, 1, 2, 1, 6, 5, 3, 1, 3, 2, 1, 3, 1, 2, 1, 4, 2, 1, 6, 5, 3, 1, 3, 2, 1, 5, 3, 1, 2, 1, 4, 4, 4, 2, 1, 6, 5, 3, 1, 3, 2, 1, 3, 1, 3, 1, 2, 1, 9, 4, 4, 4, 2, 1, 6, 5, 3, 1, 3, 2, 1, 2, 3, 1, 3, 1, 2, 1, 6, 3, 1, 9, 4, 4, 4, 2, 1, 6, 5, 3, 1
Offset: 1

Views

Author

Joseph Myers, Sep 04 2009

Keywords

Crossrefs

In other bases: A000012 (base 2), A165022 (base 4), A165042 (base 5), A165061 (base 6), A165081 (base 7), A165100 (base 8), A165120 (base 9), A164719 (base 10).

A165005 Length of cycle mentioned in A165004.

Original entry on oeis.org

2, 3, 2, 3, 2, 4, 3, 3, 2, 2, 5, 3, 3, 2, 2, 6, 5, 3, 3, 2, 3, 2, 4, 2, 6, 5, 3, 3, 2, 5, 3, 2, 4, 4, 4, 2, 6, 5, 3, 3, 2, 3, 3, 2, 9, 4, 4, 4, 2, 6, 5, 3, 3, 2, 2, 3, 3, 2, 6, 3, 9, 4, 4, 4, 2, 6, 5, 3, 3, 2, 5, 2, 3, 3, 2, 11, 6, 3, 9, 4, 4, 4, 2, 6, 5, 3, 3, 2, 5, 2, 3, 3, 2, 10, 2, 11, 6, 3, 9, 4, 4, 4, 2, 6
Offset: 1

Views

Author

Joseph Myers, Sep 04 2009

Keywords

Crossrefs

In other bases: Empty (base 2), A165024 (base 4), A165044 (base 5), A165063 (base 6), A165083 (base 7), A165102 (base 8), A165122 (base 9), A164721 (base 10).
Previous Showing 21-27 of 27 results.