Repeat "Number of Times". Possible?

Very often I have tasks (Y) which have established frequency, but another task (X) will determine intervals.

What I do now is I create a master task (Y) with exact number of sub-tasks in it.

It works, but it’s not an ideal solution.

is there any ways to determine the number of repetitions not involving time intervals?