Acknowledgements:
Got the logic for 6, 4, 10... series
here