Hi... The idea is very simple... We need to have a mod 5 counter...
000
001
010
011
100
000
001
010
.
.
.
.
As you can see the middle bit has a period of 5 times the system clock... It is high for two clock cycles and low for three clock cycles. This is 'Y'.
To get 'A', I have connected 'Y' and system clock to an AND gate.. When 'Y' is high...The output will be the same as system clock....(you get two cycles).
To get 'B', I have connected 'Ycomplement' and system clock to another AND gate.. The output is 'B'... The output is same as system clock when the Y is low(you get three clock cycles)... And voila...