There are several problems with the circuit.
1. There is no "switch on reset".
2. The LED will only flash 4 times not 5.
3. The transistor is unnecessary, I would have used the Enable input to stop the count at 8.
I will now elaborate on these points:-
The 4O17 is a 5 stage Johnson counter, configured to operate as a Modulo 10 counter.
Having 5 stages, means that it has 2^5 = 32 possible states.
When a power is first applied, it will start in one of these states at random.
Therefore it needs some way to reset the counter to zero when the power is applied.
This is usually called a "switch on reset" circuit.
The LED will flash at states as 0, 2, 4 and 6.
The counter is prevented from counting beyond 8 so the LED will be on continuously (as intended).
It would be easier to use a 4 stage binary counter.
See the attachment.
The "switch on reset" circuit provides a brief pulse to reset the counter when power is applied.
The LED will flash at 0, 2, 4, 6, 8.
When it reaches 10, the Enable input goes low so the counting is stopped thus the LED is on permanently.