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 11-19 of 19 results.

A165078 Consider the base-7 Kaprekar map n->K(n) defined in A165071. Sequence gives numbers belonging to cycles of length greater than 1.

Original entry on oeis.org

144, 192, 1068, 1752, 1836, 9936, 10608, 13008, 13680, 15072, 55500, 72012, 77388, 89112, 91212, 91800, 640992, 643344, 660144, 674592, 760992, 780144, 3562968, 4605036, 4642668, 4772952, 5445336, 5464152, 31412208, 31680336, 32353344
Offset: 1

Views

Author

Joseph Myers, Sep 04 2009

Keywords

Comments

Initial terms in base 7: 264, 363, 3054, 5052, 5232, 40653, 42633, 52632, 54612, 61641.

Crossrefs

In other bases: Empty (base 2), A165000 (base 3), A165019 (base 4), A165039 (base 5), A165058 (base 6), A165097 (base 8), A165117 (base 9), A099010 (base 10).

A165097 Consider the base-8 Kaprekar map n->K(n) defined in A165090. Sequence gives numbers belonging to cycles of length greater than 1.

Original entry on oeis.org

1022, 1589, 2044, 2212, 2723, 3122, 3178, 3290, 17892, 20475, 21483, 21987, 25578, 26586, 102837, 177443, 217938, 1445787, 1449819, 1646442, 1707930, 1715994, 1740690, 1752786, 1777482, 1941345, 1978137, 1982169, 6589877, 11381027
Offset: 1

Views

Author

Joseph Myers, Sep 04 2009

Keywords

Comments

Initial terms in base 8: 1776, 3065, 3774, 4244, 5243, 6062, 6152, 6332, 42744, 47773.

Crossrefs

In other bases: Empty (base 2), A165000 (base 3), A165019 (base 4), A165039 (base 5), A165058 (base 6), A165078 (base 7), A165117 (base 9), A099010 (base 10).

A165117 Consider the base-9 Kaprekar map n->K(n) defined in A165110. Sequence gives numbers belonging to cycles of length greater than 1.

Original entry on oeis.org

16, 48, 320, 400, 2256, 3712, 3856, 5168, 5312, 5456, 34960, 40080, 42240, 49520, 55360, 183696, 250592, 308992, 322096, 323392, 388992, 419888, 440192, 446096, 448688, 454592, 505792, 511696, 512992, 3496800, 3916640, 31596672, 35193008
Offset: 1

Views

Author

Joseph Myers, Sep 04 2009

Keywords

Comments

Initial terms in base 9: 17, 53, 385, 484, 3076, 5074, 5254, 7072, 7252, 7432.

Crossrefs

In other bases: Empty (base 2), A165000 (base 3), A165019 (base 4), A165039 (base 5), A165058 (base 6), A165078 (base 7), A165097 (base 8), A099010 (base 10).

A164723 Numbers belonging to cycles of length 2 under the Kaprekar map A151949.

Original entry on oeis.org

53955, 59994, 8733209876622, 9665429654331, 873332098766622, 966543296654331, 8764421997755322, 8765431997654322, 87333320987666622, 96654332966654331, 8733333209876666622, 9665433329666654331
Offset: 1

Views

Author

Joseph Myers, Aug 23 2009

Keywords

Crossrefs

A164725 Numbers belonging to cycles of length 3 under the Kaprekar map A151949.

Original entry on oeis.org

64308654, 83208762, 86526432, 6431088654, 6433086654, 6543086544, 8321088762, 8332087662, 8653266432, 8655264432, 8732087622, 8765264322, 9751088421, 9755084421, 9775084221, 643110888654, 643310886654, 643330866654
Offset: 1

Views

Author

Joseph Myers, Aug 23 2009

Keywords

Crossrefs

A164727 Numbers belonging to cycles of length 5 under the Kaprekar map A151949.

Original entry on oeis.org

86420987532, 86541975432, 87641975322, 88431976512, 96641975331, 8643209876532, 8654209875432, 8654319765432, 8764209875322, 8764319765322, 8765419754322, 8843209876512, 8843319766512, 8854319765412, 8874319765212
Offset: 1

Views

Author

Joseph Myers, Aug 23 2009

Keywords

Crossrefs

A164729 Numbers belonging to cycles of length 7 under the Kaprekar map A151949.

Original entry on oeis.org

420876, 642654, 750843, 840852, 851742, 860832, 862632, 43208766, 64326654, 75308643, 84308652, 85317642, 86308632, 86326632, 4332087666, 6433266654, 7533086643, 8433086652, 8533176642, 8633086632, 8633266632, 433320876666
Offset: 1

Views

Author

Joseph Myers, Aug 23 2009

Keywords

Crossrefs

A160761 The Kaprekar binary numbers in decimal.

Original entry on oeis.org

9, 9, 9, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 45, 45, 49, 45, 49, 49, 45, 45, 49, 49, 45, 49, 45, 45, 45, 49, 49, 45, 49, 45, 45, 49, 45, 45, 45, 93, 93, 105, 93, 105, 105, 105, 93, 105, 105, 105, 105, 105, 105, 93, 93, 105, 105, 105, 105, 105, 105, 93, 105, 105, 105
Offset: 1

Views

Author

Damir Olejar, May 25 2009

Keywords

Examples

			The number 9 is 1001 in binary. The maximum number using the same number of 0's and one's is found and the minimum number having the same number of 0's and 1's is found to obtain the equation such as 1100 - 0011 = 1001. Repeating the same procedure always gives us the same number and pattern of 0's and 1's. Therefore 9 is one of the Kaprekar numbers. Numbers that end the procedure in 0 are excluded since they are not Kaprekar numbers.
		

References

  • M. Charosh, Some Applications of Casting Out 999...'s, Journal of Recreational Mathematics 14, 1981-82, pp. 111-118
  • D. R. Kaprekar, On Kaprekar numbers, J. Rec. Math., 13 (1980-1981), 81-82.

Crossrefs

Programs

  • Java
    class pattern { public static void main(String args[]) { int mem1 = 0; int mem2 =1; for (int i = 1; i<3000; i++) {do { mem1 = mem2; String binaryi = Integer.toBinaryString(i); String binarysort = ""; String binaryminimum = ""; for (int n = 0; n< binaryi.length(); n++) { String g = binaryi.substring(n,n+1); if (g.equals("0")){ binarysort = binarysort+"0"; } else { binarysort = "1"+binarysort; binaryminimum = binaryminimum + "1"; } } int binrev1 = Integer.parseInt(binarysort , 2); int binrev2 = Integer.parseInt(binaryminimum , 2); int diff = binrev1 - binrev2; mem2 = diff; } while (mem2!=0 && mem2!=mem1); String memtobin = Integer.toBinaryString(mem1); int ones = 0; for (int t = 0; t
    				
  • Mathematica
    nmax = 100; f[n_] := Module[{id, sid, min, max}, id = IntegerDigits[n, 2]; min = FromDigits[sid = Sort[id], 2]; max = FromDigits[Reverse[sid], 2]; max - min]; Reap[Do[If[(fpn = FixedPoint[f, n]) > 0, Sow[fpn]], {n, 1, nmax}]][[2, 1]] (* Jean-François Alcover, Apr 23 2017 *)

Formula

1. Sort all integers from the number in descending order 2. Sort all integers from the number in ascending order 3. Subtract ascending from descending order to obtain a new number 4. Repeat the steps 1-3 with a new number until a repetitive sequence is obtained or until a zero is obtained. 5. Call the repetitive sequence's number a Kaprekar number, ignore zeros.

A177686 If a1a2a3 is a 3-digit integer in a concatenated form, we define two permutations of its digits as follows: P1(a1a2a3)=a2a3a1 and P2(a1a2a3)=a1a3a2, then we take the absolute value of their difference. Thus we form a sequence: a1a2a3, abs(P1(a1a2a3)-P2(a1a2a3)), and so on.

Original entry on oeis.org

99, 891, 198, 792, 297, 693, 396, 594, 495
Offset: 1

Views

Author

F. Smarandache (smarand(AT)unm.edu), May 10 2010

Keywords

Comments

This is an alternative to Kaprekar's routine. It would be interested in studying 4-digit integers with the permutations P1(a1a2a3a4)=a2a3a4a1 and P2(a1a2a3a4)=a1a3a4a2. Other permutations can be also studied. A generalization of Kaprekar's routine is the following: Let f be an operator that maps a finite set A={a1, a2, ..., a_p}, with p>=1 elements, into itself. Then, for any value 'a' in A, we have f(a) belongs to A too. If we iterate this operator multiple times, we get a chain: a, f(a), f(f(a)), ..., f(f...f(a)...), ... all of whose elements are in A. But, since A is finite, after at most p iterations we get two equal iterations. Therefore we end up in a finite cycle (of one or more terms).

Examples

			Starting with 100, we get abs(001-100)=099, then abs(990-099)=891, then abs(918-819)=099, etc. So 100, 099, 891, 099, ... (the cycle is 099, 891). Each three-digit number ends up in a cycle of two terms (such as: 99 and 891, or 198 and 792, or 297 and 693, or 396 and 594), or in a constant 495 (as in Kaprekar's routine).
Starting with 495, we get abs(954-459)=495 (cycle of one term).
		

Crossrefs

Formula

abs(P1(a1a2a3)-P2(a1a2a3)) = abs(a2a3a1-a1a3a2) = 99x(a2-a1).

Extensions

Added keyword:base,fini,full as there are only 9 different values obtained by the abs() starting from any a1a2a3 in the range 100 to 999 R. J. Mathar, May 15 2010
Previous Showing 11-19 of 19 results.