Minecraft wiki entry for Command_blocks_and_functions, associated text: Use the following sets of commands for recursion:
/scoreboard objectives add counter dummy
/scoreboard players set target_count counter <target count>
/execute if score count counter < target_count counter <chained command>
/execute unless score count counter < target_count counter run scorebard objectives remove counter
/scoreboard players add count counter 1