The answer should be the source voltage divided by the voltage drop of 1 LED. So if your source is 12v, and your LEDs have a voltage drop of 3.5, 12/3.5v, gives you 3 LEDs. If the the forward voltage drop of the LEDs was exactly 3 volts, you'd be able to drive 4 of them, and would not need a current limiting resistor.
The resistance of the current limiting resistor will vary with how many LEDs you're driving in series.
If you have 3 3.3 volt LEDs, you need to figure out the amount of leftover voltage to calculate the current limiting resistor. Thats 12-(3.3*3), or 2.1 volts. Use 2.1 volts in your current calculation. 2.1/.02= 105 ohms. You want the next larger E24 resistor value, or 110 ohms. If you assume your LEDs have a 3.2 volt drop, you'd use (12-(3.2*3))/.02 to calculate your current limiting resistor. That gives 120, which is an exact match. You'd use a 120 ohm resistor.
Edit: If you want to run 20 LEDs, arrange them in groups of 3 series LEDs, each with a 120 ohm resistor, and all the 3 LED chains wired in parallel. Like this:
simulate this circuit – Schematic created using CircuitLab
P.S. A 4.7k resistor would probably prevent even 1 LED from lighting. It would only allow about 1.8 mA to flow through a single LED from a 12 volt supply, and with 3 in series you'd only get about 4.4 microamps through each LED.