You can make an arbitrary period one: For a number n , just take n-1 different characters, cocatenate them, and repeat that twice. For example 5 => 12341234.
And after analyzing 165128676548312767443746382 a bit I found that some place only appear certain digits second digit can only be 2,5,3,6 second last digits is 1,7,8
And there is no 8 following 1
I've think up a possiblity: Maybe our test to pattern (123) or similar is at some point wrong we might get the same string, but wrong index, since there are multiple dupe char
If we mark every char with their orginal index and keep looping until every char is looped back to it's own index, something may show up
Swap encoding code-golfstring
Swap encoding is an encoding method where you iterate through a string, reversing sections of it between pairs of identical characters.
The basic algorithm
For each character in the string:
Check: Does the string contain the character again, after the instance you fo...
About the string that will return to it's own state after certain time of being swapped
I've found that if first char equal last char and is unique pair(which means it can't be found on other char that is not first and last) It will need atmost 2 step to restore
and you can reverse swap by literally doing swap reversed
What make those difference? that's interesting question
After a bit of research, if we prove that it's a finite group(which is confirmed for now) and do not loop to other values other then original value, we can say that it will always loop back to original value
So all we need to prove is that every step is unique and don't have dupe
Confusing, after asking others(my math teacher) about this, I've learned that it may have something to do with group action