There are thousands of posts for this function. Some will work with some Plcs but not all. This logic relies on the scan cycle of the PLC. It would not work with hard wiring.
Most of us on this site have always cryptically answered this question
About 100% of these are student related. You need to do the effort
This is a favorite training question of mine too
He is refering to using the .ACC/0 bit of a counter. When the value of the ACC is odd bit .ACC/0 is set. When it is even the bit is clear. Its a simple way to make a retentive flip flop. (Counter never needs to be reset, ignore preset and .dn bits)
If you look at the accumulator value in binary
0 = 000
1 = 001
2 = 010
3 = 011
4 = 100
5 = 101
6 = 110
notice how each time the counter upcounts the least significant digit changes state.