Need some help with LED binary counter, not sure if it's hardware or software

The resistors should be there to protect the Arduino. They prevent the LEDs from drawing too much current. You can damage the output pins without them.