The LED circuit below is an example of using 25 white LEDs in series connected to the 120VAC line. It can be modified for more or less LEDs by adjusting the resistor value. The exact resistance will depend on the particular LEDs used. But working out the resistor value is a bit complicated since current will not continously flow through the resistor.
In operation, the output of the bridge rectifier will be about 120 DC RMS or 170 volts peak. If we use 25 white LEDs with a forward voltage of 3 volts each, the total LED voltage will be 75 volts. The peak resistor voltage will be 170- 75 or 95 volts but the resistor voltage will not be continous since the input must rise above 75 before any current flows. This (dead time) represents about 26 degrees of the 90 degree half wave rectified cycle, (asin) 75/170 = (asin) .44 = 26 degrees. This means the resistor will conduct during 90-26 = 64 degrees, or about 71 percent of the time. Next we can work out the peak LED current to determine the resistor value. If the LED current is 20mA RMS, the peak current will be 20*1.414 or 28mA. But since the duty cycle is only 71 percent, we need to adjust this figure up to 28/0.71 = 39mA. So, the resistor value should be 95/.039 = 2436 ohms (2.4K) and the power rating will be .02^2 *2400= .96 watts. A two watt size is recommended. Now this circuit can also be built using 2 diodes and resistor as shown in the lower drawing. The second diode in parallel with the LEDs is used to avoid a reverse voltage on the LEDs in case the other diode leaks a little bit. It may not be necessary but I thought it was a good idea. Working out the resistor value is similar to the other example and comes out to about half the value of the full wave version, or about 1.2K at 1 watt in this case. But the peak LED current will be twice as much or about 78mA. This is probably not too much, but you may want to look up the maximum current for short duty cycles for the LEDs used and insure 79mA doesn’t exceed the spec.
Visit Here for more.