Series from For loop (is there a repository for Integer Sequences?)

Now I understand why I should not declare global variables lo & dir as I did. Thank you. @GoToLoop

When I say there is something wrong, I mean your
seq4_1_20 = periodicIntSeqRepeatedNTimes(4, 20);
in post 11 does not give the same result as the same code in your post 6.

https://discourse.processing.org/t/series-from-for-loop-is-there-a-repository-for-integer-sequences/44970/6
https://discourse.processing.org/t/series-from-for-loop-is-there-a-repository-for-integer-sequences/44970/11

My reason for breaking everything into single lines and using first_function, second_function, and so on is to increase understanding (and to appreciate the beauty) of the code. When it is all understood and appreciated, it can all be packed up again. An analogous example, if I was trying to find the formula for determining whether a number was prime or not I would ignore a function (if was available) called something like isPrime(). It would do the job, but I wouldn’t learn much by using it.

Can we use the same function for 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, …