The Circuit

The circuit is very basic, although I recognize that it requires some improvements, as well as this, we can use it to perform the respective tests, consists mainly and only of the integrated circuit CD4017, which as you know, is a counter, the pulses will give them SW1 , in this case I have put a button for the simulation, but the idea is to replace it with an infrared receiver, so that each time we generate a pulse with the control of our TV, this pulse, activate the CD4017 counter and obtain the desired result , I invite you to make this circuit in a simulator before taking it to real life, so you can experiment and get familiar with it.