I see that I missed some informations.
The pin on arduino receives up to 40 mA. This Arduino MEGA2560 operates at 5 Volt. I shall use 1/4 Watt resistor or more if necessary.
In final edition, it shall has 39 resistors in serial connection.
How much Ohm in each resistor does it need ?
Still confusing. An arduino digital or analog pin is in in input mode it 'receives' (or requires, or demands, or draws) almost no current, they are very high impedance inputs.
When an arduino digital pin is in output pin mode one can draw a maximum current from the pin at 40ma, and if more current is attempted to be drawn from the output pin, pin damage can result.