Hi guys. I need some help for a math logic puzzle.

here's an example.



Arrange the numbers but, do not allow to be followed by the next two or three numbers