_Title "Iterated digits squaring - Rosetta Code david_uwi version mod b+" ' from https://www.qb64.org/forum/index.php?topic=4160.msg135168#msg135168
' copied and modified by b+ for a timed test with FB version 2021-09-06
' mod notes: change all to _Integer64 and Loop nDigits 1 to 19
nn = 8 'this is the number of digits 8 --> 100,000,000
start!
= Timer(.001) 'this is not reliable for these short execution times pp = 81 * nn
sum = 0
sq1 = i * i
qsq(i + 1) = sq1
xb(sq1, 1) = xb(sq1, 1) + 1
qsq(1) = 0
m89 = 0
ind = j + qsq(k)
xb(ind, jkl) = xb(ind, jkl) + xb(j, jkl - 1)
xa(i) = xb(i, jkl) + xa(i)
sum = sum + xa(i)
z1 = i
k = 0
k = k + 1
a = 0
a = z1 \ 100
b = z1 \ 10
z1 = a * a + b * b + c * c
Print "For 10 ^"; nn;
" the number ending in 89 ="; m89
'Print "number ending in 1 = "; m1 + 1
'Print "total numbers = "; m1 + m89 + 1