This example shows how to use mathematical operations with counters. It may be useful for loops in latex.
Addition: \addtocounter{num}{n}
this command adds n to num, where num is a counter and n is a positive integer.
Subtraction: \addtocounter{num}{-n}
this command subtracts n from num, where n...