We investigated how indexed FOR-loops, such as the ones found in procedural programming languages, can be implemented in genetic programming. We use them to train programs that learn the repeating unit string of a given regular binary pattern string and can reproduce the learnt pattern to an arbitrary size, specified by a parameter N. We discovered that this particular problem, where the solution needs to scale with multiple size-instances of the problem, is very hard to solve without the help of domain knowledge. Categories and Subject Descriptors: I.2.2 Artificial Intelligence: Automatic Programming General Terms: Algorithms