login

Revision History for A151957

(Bold, blue-underlined text is an addition; faded, red-underlined text is a deletion.)

Showing all changes.
Iterate the Kaprekar map of A151949 starting at the n-digit number 100...02; sequence gives the lowest number in the resulting cycle.
(history; published version)
#9 by Bruno Berselli at Fri Dec 05 04:52:52 EST 2014
STATUS

proposed

approved

#8 by Michel Marcus at Fri Dec 05 03:32:07 EST 2014
STATUS

editing

proposed

#7 by Michel Marcus at Fri Dec 05 03:32:01 EST 2014
MAPLE

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

# R. J. Mathar, Aug 20 2009

EXTENSIONS

Extended by _R. J. Mathar _ and Joseph Myers, Aug 20 2009

STATUS

approved

editing

#6 by Russ Cox at Fri Mar 30 18:51:45 EDT 2012
AUTHOR

_Harvey P. Dale (hpd1(AT)nyu.edu) _ and N. J. A. Sloane, Aug 18 2009, Aug 19 2009

Discussion
Fri Mar 30
18:51
OEIS Server: https://oeis.org/edit/global/252
#5 by Russ Cox at Fri Mar 30 17:28:42 EDT 2012
LINKS

Joseph Myers, <a href="/A151957/b151957.txt">Table of n, a(n) for n=2..1000</a> [From _Joseph Myers (jsm(AT)polyomino.org.uk), _, Aug 21 2009]

EXTENSIONS

Extended by R. J. Mathar and _Joseph Myers (jsm(AT)polyomino.org.uk), _, Aug 20 2009

Discussion
Fri Mar 30
17:28
OEIS Server: https://oeis.org/edit/global/152
#4 by Russ Cox at Fri Mar 30 16:51:07 EDT 2012
AUTHOR

Harvey P. Dale (hpd1(AT)nyu.edu) and _N. J. A. Sloane (njas(AT)research.att.com), _, Aug 18 2009, Aug 19 2009

Discussion
Fri Mar 30
16:51
OEIS Server: https://oeis.org/edit/global/110
#3 by Russ Cox at Sun Jul 10 18:42:15 EDT 2011
LINKS

<a href="/Sindx_index/K.html#Kaprekar_map">Index entries for the Kaprekar map</a>

Discussion
Sun Jul 10
18:42
OEIS Server: https://oeis.org/edit/global/50
#2 by N. J. A. Sloane at Thu Nov 11 07:34:06 EST 2010
LINKS

Joseph Myers, <a href="/A151957/b151957.txt">Table of n, a(n) for n=2..1000</a> [From Joseph Myers (jsm(AT)polyomino.org.uk), Aug 21 2009]

<a href="/Sindx_K.html#Kaprekar_map">Index entries for the Kaprekar map</a>

KEYWORD

nonn,base,new

#1 by N. J. A. Sloane at Tue Jun 01 03:00:00 EDT 2010
NAME

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

DATA

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

OFFSET

2,2

LINKS

Joseph Myers, <a href="b151957.txt">Table of n, a(n) for n=2..1000</a> [From Joseph Myers (jsm(AT)polyomino.org.uk), Aug 21 2009]

<a href="Sindx_K.html#Kaprekar_map">Index entries for the Kaprekar map</a>

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:

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

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]

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.

KEYWORD

nonn,base

AUTHOR

Harvey P. Dale (hpd1(AT)nyu.edu) and N. J. A. Sloane (njas(AT)research.att.com), Aug 18 2009, Aug 19 2009

EXTENSIONS

Extended by R. J. Mathar and Joseph Myers (jsm(AT)polyomino.org.uk), Aug 20 2009

STATUS

approved