Loops are fundamental constructs in programming, used to repeatedly execute code blocks. While traditional programming studies focus on implementation and runtime, there is limited work on formalizing loops as mathematical objects. In this paper, we present a novel framework to model Python for loops as finite summations over arithmetic progressions, incorporating runtime per iteration. By leveraging concepts from applied mathematics, including arithmetic sequences and discrete summations, we demonstrate how loops can be analyzed theoretically, forming a foundation for more advanced analyses of nested loops, conditionals, and program structure.
Prasoon Jadon (Tue,) studied this question.