I am currently in the process of transforming my programming code into mathematical equations for my bachelor thesis.
My pseudocode looks like this:
for i