NPN (Not Pin In)
So the direct connect LED math works out to be.
(5V-1.5V)/20mA = 175 ohm resistor. Usually you use a 220 ohm resistor to dissipate the 3.5V.
using the 1k ohm resistor you get: (5V-1.5Vled)/1k ohm = 3.5mA. 3.5mA /20mA is a 17.5% duty cycle. It is like running PWM on Arduino.
The LED connected to the 2N2222A connects to the 5V