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.

Showing 1-10 of 51 results. Next

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

Original entry on oeis.org

53955, 59994, 61974, 62964, 63954, 71973, 74943, 75933, 82962, 83952, 420876, 642654, 750843, 840852, 851742, 860832, 862632, 7509843, 7519743, 7619733, 8429652, 8439552, 8649432, 8719722, 9529641, 43208766, 64308654, 64326654
Offset: 1

Views

Author

Klaus Brockhaus, Sep 22 2004

Keywords

Comments

86526432, 64308654, 83208762 form a cycle of length three and 86308632, 86326632, 64326654, 43208766, 85317642, 75308643, 84308652 form a cycle of length seven.

Examples

			53955 and 59994 form a cycle of length 2 and hence are terms: 53955 -> 95553 - 35559 = 59994 -> 99954 - 45999 = 53955.
		

Crossrefs

Cf. A164715 (corresponding cycle lengths) [From Joseph Myers, Aug 24 2009]
In other bases: Empty (base 2), A165000 (base 3), A165019 (base 4), A165039 (base 5), A165058 (base 6), A165078 (base 7), A165097 (base 8), A165117 (base 9). [From Joseph Myers, Sep 05 2009]

Extensions

Definition revised ny N. J. A. Sloane, Aug 18 2009
Extended by Joseph Myers, Aug 22 2009

A151959 Consider the Kaprekar map x->K(x) described in A151949. Sequence gives the smallest number that belongs to a cycle of length n under repeated iteration of this map, or -1 if there is no cycle of length n.

Original entry on oeis.org

0, 53955, 64308654, 61974, 86420987532
Offset: 1

Views

Author

Klaus Brockhaus and N. J. A. Sloane, Aug 19 2009

Keywords

Comments

No cycle of length 6 is presently known!
It is also known that a(7) = 420876, a(8) = 7509843, a(14) = 753098643.
From Joseph Myers, Aug 19 2009: (Start)
One does not need to consider every integer of n digits, only the sorted sequences of n digits (of which there are binomial(n+9, 9), so 28048800 for 23 digits). Then you only need to consider those sorted sequences of digits whose total is a multiple of 9, as the number and so the sum of its digits is always a multiple of 9 after the first iteration, which reduces the work by a further factor of about 9.
As a further refinement, the result of a single subtraction, if not zero, will have digit sequence of the form
d_1 d_2 ... d_k-1 9...9 9-d_k ... 9-d_2 9-d_1+1
where the values d_i are in the range 1 to 9 and the sequence of 9's in the middle may be empty.
From this form it follows that for any member of a cycle,
abs(number of 8's - number of 1's) + abs(number of 7's - number of 2's) +
abs(number of 6's - number of 3's) + abs(number of 5's - number of 4's) +
max(0, number of 0's - number of 9's) <= 4,
so given the numbers of 0's, 1's, 2's, 3's and 4's there is little freedom left in choosing the number of each remaining digit.
No further cycle lengths exist up to at least 140 digits. The only 4-cycles up to there are the ones containing 61974 and 62964, the only 8-cycles up to there are the ones containing 7509843 and 76320987633, the only 14-cycle up to there is the one containing 753098643. All the 7-cycles so far follow the pattern
7-cycle: 420876
7-cycle: 43208766
7-cycle: 4332087666
7-cycle: 433320876666
7-cycle: 43333208766666
7-cycle: 4333332087666666 ... (End)

Examples

			a(1) = 0: 0 -> 0.
a(2) = 53955: 53955 -> 59994 -> 53955 -> ...
a(3) = 64308654: 64308654 -> 83208762 -> 86526432 -> 64308654 -> ...
a(4) = 61974: 61974 -> 82962 -> 75933 -> 63954 -> 61974 -> ...
		

Crossrefs

A099009 gives the fixed points and A099010 gives numbers in cycles of length > 1.
Cf. A151949.
In other bases: A153881 (base 2), A165008 (base 3), A165028 (base 4), A165047 (base 5), A165067 (base 6), A165086 (base 7), A165106 (base 8), A165126 (base 9). [Joseph Myers, Sep 05 2009]

Extensions

The term a(3) = 64308654 was initially only a conjecture, but was confirmed by Zak Seidov, Aug 19 2009
a(4) = 61974 corrected by R. J. Mathar, Aug 19 2009 (we had not given the smallest member of the 4-cycle).
a(4) = 61974, a(7) = 420876, and a(8) = 7509843 confirmed by Zak Seidov, Aug 19 2009 (formerly the a(8) value was just an upper bound)
a(5) = 86420987532 and a(14) = 753098643 from Joseph Myers, Aug 19 2009. He also confirms the other values, and remarks that there are no other cycle lengths up to at least 140 digits.

A164716 Consider the Kaprekar map n->K(n) defined in A151949. Sequence gives numbers belonging to cycles, including fixed points.

Original entry on oeis.org

0, 495, 6174, 53955, 59994, 61974, 62964, 63954, 71973, 74943, 75933, 82962, 83952, 420876, 549945, 631764, 642654, 750843, 840852, 851742, 860832, 862632, 7509843, 7519743, 7619733, 8429652, 8439552, 8649432, 8719722, 9529641, 43208766
Offset: 1

Views

Author

Joseph Myers, Aug 23 2009

Keywords

Crossrefs

In other bases: A163205 (base 2), A164998 (base 3), A165017 (base 4), A165037 (base 5), A165056 (base 6), A165076 (base 7), A165095 (base 8), A165115 (base 9). [From Joseph Myers, Sep 05 2009]

A164718 Consider the Kaprekar map n->K(n) defined in A151949. Sequence gives least elements of each cycle, including fixed points.

Original entry on oeis.org

0, 495, 6174, 53955, 61974, 62964, 420876, 549945, 631764, 7509843, 43208766, 63317664, 64308654, 97508421, 554999445, 753098643, 864197532, 4332087666, 6333176664, 6431088654, 6433086654, 6543086544, 9751088421, 9753086421
Offset: 1

Views

Author

Joseph Myers, Aug 23 2009

Keywords

Crossrefs

In other bases: A163205 (base 2), A165002 (base 3), A165021 (base 4), A165041 (base 5), A165060 (base 6), A165080 (base 7), A165099 (base 8), A165119 (base 9). [From Joseph Myers, Sep 05 2009]

A164720 Consider the Kaprekar map n->K(n) defined in A151949. Sequence gives least elements of each cycle of length > 1.

Original entry on oeis.org

53955, 61974, 62964, 420876, 7509843, 43208766, 64308654, 753098643, 4332087666, 6431088654, 6433086654, 6543086544, 9751088421, 76320987633, 86420987532, 433320876666, 643110888654, 643310886654, 643330866654
Offset: 1

Views

Author

Joseph Myers, Aug 23 2009

Keywords

Crossrefs

In other bases: Empty (base 2), A165004 (base 3), A165023 (base 4), A165043 (base 5), A165062 (base 6), A165082 (base 7), A165101 (base 8), A165121 (base 9). [From Joseph Myers, Sep 05 2009]

A164731 Number of cycles of n-digit numbers (including fixed points) under the Kaprekar map A151949.

Original entry on oeis.org

1, 0, 1, 1, 3, 3, 1, 4, 3, 8, 3, 16, 5, 27, 8, 46, 9, 73, 11, 110, 16, 162, 25, 231, 37, 318, 58, 429, 88, 572, 132, 747, 192, 963, 269, 1229, 372, 1551, 500, 1939, 662, 2401, 864, 2948, 1115, 3586, 1421, 4330, 1792, 5194, 2240, 6191, 2764, 7338, 3382, 8650, 4105
Offset: 1

Views

Author

Joseph Myers, Aug 23 2009

Keywords

Crossrefs

In other bases: A004526 (base 2, adjusted to start 1, 0, 0, 1, 1, ...), A165006 (base 3), A165025 (base 4), A165045 (base 5), A165064 (base 6), A165084 (base 7), A165103 (base 8), A165123 (base 9). [Joseph Myers, Sep 05 2009]

A164732 Number of n-digit numbers in a cycle (including fixed points) under the Kaprekar map A151949.

Original entry on oeis.org

1, 0, 1, 1, 10, 9, 8, 12, 16, 22, 14, 42, 18, 73, 29, 125, 34, 199, 38, 308, 49, 462, 71, 665, 105, 920, 161, 1243, 249, 1658, 379, 2170, 555, 2806, 780, 3587, 1075, 4539, 1449, 5689, 1922, 7059, 2516, 8677, 3252, 10566, 4156, 12774, 5255, 15337, 6578, 18300
Offset: 1

Views

Author

Joseph Myers, Aug 23 2009

Keywords

Crossrefs

In other bases: A004526 (base 2, adjusted to start 1, 0, 0, 1, 1, ...), A165007 (base 3), A165026 (base 4), A165046 (base 5), A165065 (base 6), A165085 (base 7), A165104 (base 8), A165124 (base 9). [Joseph Myers, Sep 05 2009]

A151950 a(n) = A151949(n)/9.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 11, 11, 22
Offset: 0

Views

Author

N. J. A. Sloane, Aug 18 2009

Keywords

Crossrefs

In other bases: A164884 (base 2), A164994 (base 3), A165013 (base 4), A165033 (base 5), A165052 (base 6), A165072 (base 7), A165091 (base 8), A165111 (base 9). [From Joseph Myers, Sep 05 2009]

Programs

  • PARI
    a(n) = my(d=digits(n)); (fromdigits(vecsort(d,,4)) - fromdigits(vecsort(d)))/9; \\ Michel Marcus, Sep 25 2018

Extensions

Extended by Joseph Myers, Aug 28 2009

A164733 Number of n-digit fixed points under the Kaprekar map A151949.

Original entry on oeis.org

1, 0, 1, 1, 0, 2, 0, 2, 2, 3, 1, 5, 1, 6, 2, 8, 2, 12, 3, 14, 5, 17, 7, 21, 8, 25, 12, 30, 14, 36, 17, 43, 21, 49, 25, 58, 31, 66, 36, 75, 43, 85, 49, 96, 58, 109, 66, 121, 75, 136, 86, 150, 96, 167, 109, 184, 121, 202, 136, 222, 150, 242, 167, 265, 185, 287, 202, 313, 222, 338
Offset: 1

Views

Author

Joseph Myers, Aug 23 2009

Keywords

Crossrefs

Bisections: A309223, A309224.
In other bases: A004526 (base 2, adjusted to start 1, 0, 0, 1, 1, ...), A008615 (base 3), A165027 (base 4), A008617 (base 5), A165066 (base 6), A008722 (base 7, conjecturally), A165105 (base 8), A165125 (base 9). [From Joseph Myers, Sep 05 2009]

Formula

Conjectures from Chai Wah Wu, Apr 13 2024: (Start)
a(n) = a(n-2) + a(n-6) - a(n-8) + a(n-9) - a(n-11) + a(n-14) - a(n-15) - a(n-16) + a(n-17) - a(n-20) + a(n-22) - a(n-23) + a(n-25) + a(n-29) - a(n-31) for n > 33.
G.f.: x*(-x^32 + x^31 - x^29 + x^28 - x^27 + x^26 - x^24 + 2*x^23 - x^22 + x^21 + x^20 + 2*x^18 - x^17 + x^16 + 2*x^15 - 3*x^14 + 2*x^13 - x^12 + x^11 - x^9 + 2*x^8 - x^6 + x^5 - x^4 + x^3 + 1)/(x^31 - x^29 - x^25 + x^23 - x^22 + x^20 - x^17 + x^16 + x^15 - x^14 + x^11 - x^9 + x^8 - x^6 - x^2 + 1). (End)

A151962 Length of preperiodic part of trajectory of n under iteration of the Kaprekar map in A151949.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Aug 19 2009

Keywords

Examples

			13 -> 18 -> 63 -> 27 -> 45 -> 9 -> 0 -> 0, so a(13)=6.
		

Crossrefs

Cf. A151949, A151963. Strictly different from A072137.
In other bases: A164885 (base 2), A164995 (base 3), A165014 (base 4), A165034 (base 5), A165053 (base 6), A165073 (base 7), A165092 (base 8), A165112 (base 9). - Joseph Myers, Sep 05 2009

Programs

  • Maple
    A151949 := proc(n)
    local tup;
    tup := sort(convert(n,base,10)) ;
    add( (op(i,tup)-op(-i,tup)) *10^(i-1),i=1..nops(tup)) :
    end:
    A151962 := proc(n)
    local tra,x ;
    tra := [n] ;
    x := n ;
    while true do
    x := A151949(x) ;
    if member(x,tra,'l') then
    RETURN(l-1) ;
    fi;
    tra := [op(tra),x] :
    od:
    end:
    seq(A151962(n),n=0..120) ;
    # R. J. Mathar, Aug 20 2009

Extensions

More terms from R. J. Mathar, Aug 20 2009
Showing 1-10 of 51 results. Next