Federico, welcome to this forum!
I, too, am somewhat puzzled by the last paragraph that you wrote.
Please look at this recent thread to see how to compute a definite integral, or print a list of prime numbers less than 1 million, using very few lines of Fortran code. In fact, the only “loop” that one needs in such code may be just an implied-do-list.