Given there is no Magic specific guidance for expressions and Magic doesn't implement all of ExprTk, for things like this you just have to suck it and see.
If a function is implemented you'll get a param error given nothing else. With a unimplemented function you'll get a reserved keyword error. The Magic help says 'logic and maths' which one might argue should include loops but there's probably a good reason it doesn't.
So yes, loops are not available in Magic expressions. However, Increase, Ramp and other modifiers can do much of what a loop would do.
Were you experimenting or trying to achieve something specific. Maybe there's another way.
thanks a lot for this excellent answer. I did not try anything special. I just wanted to take a deeper dive into the capabilities of the expression modifier, since it is such a powerful feature.