Calculating maximum series/parallel configurations for unique resistors
It's called (unsurprisingly) combinatory math. Is a whole branch of math devoted to it, look around.
Mostly stuff done multiplying and dividing factorials.