>>693
#module
#include "hspmath.as"
#deffunc check int n, local buf, local x
buf=str(n)
repeat strlen(buf)
x+=pow(peek(buf, cnt)-'0', cnt+1)
loop
return n=x
#global

repeat 10000
check cnt
if stat : mes cnt
loop