What controller are you using.
What pixels are you using?
Usually when pixels start changing color or flickering down a string it is as stated most likely the need for power injection?
Problems after 40 pixels seems like a very rapid voltage drop though.
Is your power supply set to 12volts, if 12v pixels, 5v if 5v pixels. Many power supplies come under adjusted for proper voltage output.