I have an inequality in integer nonnegative x,y
x+a*y<=c
where a,c – real positive.
The number of solutions equals
sum (int(c-i*a)+1 for i in range(int(c/a)+1)
Is there a compact (O(1)) formula for this number?
I have an inequality in integer nonnegative x,y
x+a*y<=c
where a,c – real positive.
The number of solutions equals
sum (int(c-i*a)+1 for i in range(int(c/a)+1)
Is there a compact (O(1)) formula for this number?