The "typical" equations go something like this:
R(LED) < (Vcc-n*2.1-0.6)/15E-3
and
P of the resistor is P = (I^2)*R
The deal is the following:
Vcc is the power supply used.
n is the # of LEDs in series
Note: you can run out of voltage.
2.1 V is the forward voltage of a typical red LED
Note It can vary, especially by color. Generally you pick the worst drop from the spec sheet.
0.6 is an estimate of the base-emitter drop of a transistor.
Note: MOSFETS: drop nearly 0V. Another concept is used.
15E-3 is a "typical" operating current for a LED.
Note: Again, this is all over the map, 15 to 50 mA is a common spec.
By saying R(LED) is less than, I mean that resistors come in certain values. i.e. 121.3 becomes 120
The resistor used has to be able to disipate the power. 1/8, 1/4, 1/2, 1, 2, 3, 5W are common values.
Thus if you get 0.230 W, you should use a 1/4 W or higher. It's good practice to check with the resistor used.