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 51 results. Next

A164735 Number of n-digit cycles of length 3 under the Kaprekar map A151949.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 1, 0, 4, 0, 10, 0, 20, 0, 36, 0, 60, 1, 94, 4, 141, 10, 204, 21, 286, 39, 392, 66, 527, 105, 696, 159, 906, 231, 1164, 326, 1477, 449, 1854, 605, 2304, 801, 2836, 1044, 3462, 1341, 4194, 1701, 5044, 2133, 6027, 2646, 7158, 3252, 8452, 3963
Offset: 1

Views

Author

Joseph Myers, Aug 23 2009

Keywords

Crossrefs

Formula

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

A164736 Number of n-digit cycles of length 5 under the Kaprekar map A151949.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 3, 0, 5, 0, 6, 0, 6, 1, 6, 3, 6, 5, 6, 6, 6, 6, 7, 6, 9, 6, 11, 6, 12, 6, 12, 7, 12, 9, 12, 11, 12, 12, 12, 12, 13, 12, 15, 12, 17, 12, 18, 12, 18, 13, 18, 15, 18, 17, 18, 18, 18, 18, 19, 18, 21, 18, 23, 18, 24, 18, 24, 19, 24, 21, 24, 23, 24, 24, 24
Offset: 1

Views

Author

Joseph Myers, Aug 23 2009

Keywords

Crossrefs

Formula

Conjectures from Chai Wah Wu, Apr 13 2024: (Start)
a(n) = a(n-1) + a(n-2) - 2*a(n-3) + a(n-4) + a(n-5) - 2*a(n-6) + a(n-7) + a(n-8) - a(n-9) for n > 15.
G.f.: x^11*(x^2 + 1)*(x^2 - x + 1)/((x - 1)^2*(x + 1)*(x^6 + x^3 + 1)). (End)

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

Original entry on oeis.org

0, 495, 6174, 62964, 420876, 7509843, 64308654, 753098643, 6431088654, 86420987532, 643330866654, 8764209875322, 64333308666654, 885432098765412, 6543331088666544, 88543320987665412, 975533110888664421
Offset: 2

Views

Author

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

Keywords

Crossrefs

See A151958 for the length of the cycles. Cf. A151949, A151955 (the trajectory of 102), A151956 (the trajectory of 1002).
See also A151967, A151968.

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:
    A151957 := proc(n)
    local tra,x ;
    x := 10^(n-1)+2 ;
    tra := [x] ;
    while true do
    x := A151949(x) ;
    if member(x,tra,'l') then
    op(l..nops(tra),tra) ;
    RETURN(min(%)) ;
    fi;
    tra := [op(tra),x] :
    od:
    end:
    seq(A151957(n),n=2..60) ;
    # R. J. Mathar, Aug 20 2009
  • Mathematica
    To find the first 20 terms of the trajectory of 10002, for instance:
    f[n_]:=Module[{idn=IntegerDigits[n],idns},idns=Sort[idn];Abs[FromDigits[ idns]-FromDigits[Reverse[idns]]]]
    NestList[f,10002,20]

Extensions

Extended by R. J. Mathar and Joseph Myers, Aug 20 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

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

A164730 Least element of each cycle of length 7 under the Kaprekar map A151949.

Original entry on oeis.org

420876, 43208766, 4332087666, 433320876666, 43333208766666, 4333332087666666, 433333320876666666, 43333333208766666666, 4333333332087666666666, 433333333320876666666666
Offset: 1

Views

Author

Joseph Myers, Aug 23 2009

Keywords

Crossrefs

A151947 a(1) = 113; 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

113, 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

N. J. A. Sloane, Aug 18 2009

Keywords

Comments

Converges to the fixed point 495. For the list of fixed points see A099009.

Crossrefs

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

A151946 a(1) = 8127; 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

8127, 7443, 3996, 6264, 4176, 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

N. J. A. Sloane, Aug 18 2009

Keywords

Comments

Similar in spirit to the RATS (Reverse, Add Then Sort) sequences.
Converges to the fixed point 6174. For the list of fixed points see A099009.
The initial value 1001 is the smallest number that converges to 6174 - see A151967.

Crossrefs

A151951 a(1) = 1113; 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

1113, 1998, 8082, 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

N. J. A. Sloane, Aug 18 2009

Keywords

Crossrefs

Programs

  • Mathematica
    NestList[FromDigits[Reverse[Sort[IntegerDigits[#]]]]-FromDigits[Sort[ IntegerDigits[ #]]]&,1113,40] (* or *) PadRight[{1113,1998,8082,8532},40,{6174}] (* Harvey P. Dale, May 10 2021 *)
Previous Showing 21-30 of 51 results. Next