What is charlieplexing?
https://en.wikipedia.org/wiki/Charlieplexing summarizes it this way:
Charlieplexing is a technique for driving a multiplexed display in which relatively few I/O pins on a microcontroller are used to drive an array of LEDs.
The combination of active pins and current direction determines which individual LED illuminates. The voltage drop of other LEDs in series prevents them from illuminating even though they are biased correctly.
This diagram makes it easy to see:
If J1 pins 1 and 3 are connected to – and + of a current source respectively, then only LED 5 will illuminate. Even though LEDs 2 and 3 have the same orientation, their combined voltage drop will prevent illumination.
Where n is the number of pins: max number of LEDs = n² – n.
I’m keeping this short short because there are so many other explanations out there already.