Question: Can seq or Seq be applied to fill our a 2 d Array?

My code below works but I an looking to speed it up to apply to large arrays. I have large integers and I want to store the exponent and first and last few digits.

nelems := 10;  ~ takes about 50mins when n=100,000,000
n := 374894756873546859847556;
op(n);
A := Array(1 .. 4, 1 .. nelems);
length(n);
st := time();
for i to nelems do
    A[1, i] := i^10*n;
    A[2, i] := length(A[1, i]) - 1;
    b := convert(A[1, i], string);
    A[3, i] := parse(b[1 .. 3]);
    A[4, i] := parse(b[-3 .. -1]);
end do;
time() - st;
A;
A[1, -2];
A[2, -2];
A[3, -2];
A[4, -2];

 

Please Wait...