Hey, no problem at all. Feel free to get back to it whenever you can, there's no hurry. I think we've all got brute force algos working but the key here would be finding the pattern of repetition and optimising the algorithm. Brute force is probably O(N^2) for all of us or maybe O(N^log(N)) but neither of us have implemented the optimal required solution of doing the 50 billion iterations in less than a minute so I think we can start working on that. I could take this question to a CP forum for help but the reason why I post here is because I've become accustomed to the people here and I find discussing things here more valuable than elsewhere.

Also, I've fixed my code. I realised there was a problem with my padding loop at the end of the string. I'm getting all correct values for the sample input cases provided. I'm waiting on john to see if our time 10001 values match. If that's positive, we'll all be on pretty much the same page to discuss what the "hack" is.