Samsung automatic washing machine going off and on automatically!
This sounds like you could be having problems with the power mains that feed the washer going on and off. This could be caused by the power delivered to the dwelling going on and off due to poor power delivery system (highly dependent on your country location). Alternatively it could be caused by intermittent wiring from where the mains power enters the dwelling and then distributed to the washer location.

It there is poor power delivery then it should also be visible via blinking or flashing lights.  

The latter case of the intermittent wiring can be a very dangerous situation as it can produce high heat and cause a dwelling fire. If you do not have the capabilities or confidence to investigate that then it is highly advised to call in a professional. In the mean time unplug the washer and stop using it until the electrical problem is fixed.