login
This site is supported by donations to The OEIS Foundation.

 

Logo

Annual Appeal: Today, Nov 11 2014, is the 4th anniversary of the launch of the new OEIS web site. 70,000 sequences have been added in these four years, all edited by volunteers. Please make a donation (tax deductible in the US) to help keep the OEIS running.

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A151962 Length of preperiodic part of trajectory of n under iteration of the Kaprekar map in A151949. 10
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 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,11

LINKS

Joseph Myers, Table of n, a(n) for n=0..1000

Index entries for the Kaprekar map

EXAMPLE

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

MAPLE

Maple program from R. J. Mathar, Aug 20 2009

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) ;

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). [From Joseph Myers, Sep 05 2009]

Sequence in context: A174959 A126093 A065279 * A072137 A061569 A140835

Adjacent sequences:  A151959 A151960 A151961 * A151963 A151964 A151965

KEYWORD

nonn,base

AUTHOR

N. J. A. Sloane, Aug 19 2009

EXTENSIONS

More terms from R. J. Mathar, Aug 20 2009

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified December 20 07:03 EST 2014. Contains 252241 sequences.