Scalable preparation of three-atom and four-atom W states via atom–cavity–laser interaction