I want to sum the digits of the first 100.000 digits of pie (I have text with the numbers), but I want to do it in a specific form.
I want to put the digits in a matrix (or whatever is convenient as a placeholder) with a small number of cells predefined by me and overlap the digits in those cells.
What I mean is this: lets say we have this list of numbers (31415926535)
and lets say we have 4 cells j,j1,j2,j3
in the first run j=3,j1=1,j2=4,j3=1 notice that each cell has been assigned with a number of the list and and the digits that are left in the list are (5926535) so I want to overlap them so that j=8 (since its value was 3 and now 5 is added), j1=10 (1 + 9) , j2=6 j3=7
And I want to do that for all my 100k digits
But I want to add an other twist on top of that
I want to print results after x amount of cycles (by cycles I mean one run like in the above example assigning j,j1,j2,j3 with 3,1,4,1 would be the 1st cycle) as well as the final result.
I would prefer a simple language such as python or haskell