I was hoping to find an even more efficient solution, but when I count the number of outputs for various length lists I get [1, 4, 7, 16, 19, 28, 43, 64, 67, 76, 91, 112, 139, 172, 211, 256]. That sequence is on
OEIS, but it doesn't list any nifty algorithms for it.