For fun... using Num2Text() - http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=202256#Post202256

Practically any number can be used, but must be in quotes once the numbers get sufficiently big enough.

 Code:
  break on
  $RC=setoption("WrapATEOL","ON")
  $RC=setoption("Explicit","ON")

  dim $i,$len

  $i="888888888888"

  if $i<>4
    ? "" + $i + " is "
    $len=len(replace(num2text($i)," ",""))
    while $len<>4
      "" + $len + ". " + $len +  " is "
      $len=len(replace(num2text($len)," ",""))
    loop
    "4. "
  endif
  "4 is magic."


Outputs

888888888888 is 114. 114 is 20. 20 is 6. 6 is 3. 3 is 5. 5 is 4. 4 is magic.


Edited by Allen (2011-05-21 12:24 PM)