CLEAR
nRows=1000
DIMENSIONAR1[nRows]
AR1=0
Q=30
STR1='1'
FOR P=1 TO Q AR1=0 I1=0 L1=LEN(STR1) FOR I2=L1 TO 1 STEP -1 I1=I1+1 AR1[I1]=VAL(SUBSTR(STR1,I2,1)) ENDFOR RELEASE AR2 ACOPY(AR1,AR2) FOR I3=1 TO P-1 FOR I4=1 TO L1 N=AR1[I4]+AR2[I4] AR1[I4]=MOD(N,10) AR1[I4+1]=AR1[I4+1]+INT(N/10) ENDFOR ENDFOR FOR I5=nRows TO 1 STEP -1 IF AR1[I5]<>0 EXIT ENDIF ENDFOR STR1='' FOR I6=I5 TO 1 STEP -1 STR1=STR1+TRANSFORM(AR1[I6]) ENDFOR ?STR1
ENDFOR