Anyway, I have concluded that my formula is indeed correct, as it matches with all the cases listed out by @pbuk.
Here is my code:
from math import factorial, comb
def NoneHaveL(m, n, L):
upperbound = min(m, n//L) if L != 0 else m
def expression(i):
if n-i*L < 0: # I don't...