UNO controlled LEDs: Resistor Question

  pinMode(9, OUTPUT);      // digital pin as output
  digitalWrite(9, HIGH);   // keep power on
  
  // initialize the digital pin as an output.
  pinMode(9, OUTPUT);

Setting the pin to output once is enough.

void loop() {
  digitalWrite(9, HIGH);   // set the LEDs on
  delay(1000);
  digitalWrite(9, LOW);    // set the LEDs off
}

This won't do what you think. It will take the pin high for 1 second, a low for about a microsecond. Thus it will look high all the time to the naked eye. You need another delay.