The CD4017 IC is a decade counter that activates ten outputs, one at a time, through a clock signal sent to the input pin 14.
When you supply the counter the first output gets high; at first the input pins (13, 14, 15) are supplied with the negative signal. If you send for an instant the high signal to the clock pin (14), the second output turns on instead of the first one.
When all outputs have been activated the cycle repeats.
If you send the positive signal to the pin 13, the clock signal will be ignored. If you send the positive signal to the pin 15, the CD4017 will reset the outputs condition.
Here you can see a 4 bit counter based on logic gates.