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-4 of 4 results.

A151958 Length of cycle mentioned in A151957.

Original entry on oeis.org

1, 1, 1, 4, 7, 8, 3, 14, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 3, 5, 3, 3, 3, 3, 3, 3, 3, 3, 5, 1, 3, 3, 3, 3, 3, 3, 1, 5, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 5, 5, 5, 1, 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, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
Offset: 2

Views

Author

Harvey P. Dale and N. J. A. Sloane, Aug 18 2009

Keywords

Crossrefs

See also A151967, A151968.

Extensions

Extended by Joseph Myers, Aug 21 2009

A151967 Iterate the Kaprekar map of A151949 starting at the n-digit number 100...01; sequence gives the lowest number in the resulting cycle.

Original entry on oeis.org

0, 0, 6174, 62964, 420876, 7509843, 64308654, 864197532, 6431088654, 86420987532, 643310886654, 8643209876532, 43333208766666, 885432098765412, 6543331088666544, 88754320987654212, 643111110888888654
Offset: 2

Views

Author

N. J. A. Sloane, Aug 20 2009

Keywords

Examples

			a(6) = 420876: 100001 -> 109989 -> 980811 -> 976221 -> 853542 -> 620874 -> 851742 -> 750843 -> 840852 -> 860832 -> 862632 -> 642654 -> 420876 -> 851742 -> ..., a cycle of length 7 with smallest member 420876.
		

Crossrefs

See A151968 for the length of the cycles. Cf. A151957, A151958.
Different from A151957.

Programs

  • Mathematica
    (Mma program from Harvey P. Dale) To find the first 20 terms of the trajectory of 10001, for instance:
    f[n_]:=Module[{idn=IntegerDigits[n],idns},idns=Sort[idn];Abs[FromDigits[ idns]-FromDigits[Reverse[idns]]]]
    NestList[f,10001,20]

Extensions

Extended by Joseph Myers, Aug 21 2009

A151955 a(1) = 102; thereafter a(n) = (a(n-1) with digits sorted into descending order) - (a(n-1) with digits sorted into ascending order) (see the Kaprekar map, A151949).

Original entry on oeis.org

102, 198, 792, 693, 594, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495, 495
Offset: 1

Views

Author

Harvey P. Dale. Aug 18 2009

Keywords

Comments

102 is the smallest starting value which does not converge to 0.
Converges to the fixed point 495. For the list of fixed points see A099009.

Crossrefs

A151956 a(1) = 1002; thereafter a(n) = (a(n-1) with digits sorted into descending order) - (a(n-1) with digits sorted into ascending order) (see the Kaprekar map, A151949).

Original entry on oeis.org

1002, 2088, 8532, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174, 6174
Offset: 1

Views

Author

Harvey P. Dale, Aug 18 2009

Keywords

Comments

For the list of fixed points see A099009.

Crossrefs

Showing 1-4 of 4 results.