Given $r$ and $t$, Is there a way to find the maximum positive integer $N$ such that:
$$2 N^2 + (2r+3)N + (2r+1) \leq t$$
I want to write a program to solve that inequality without brute-force. At least the program should be as fast as possible.
Given $r$ and $t$, Is there a way to find the maximum positive integer $N$ such that:
$$2 N^2 + (2r+3)N + (2r+1) \leq t$$
I want to write a program to solve that inequality without brute-force. At least the program should be as fast as possible.
Use the quadratic formula and floor the result(s):
In standard form: $0 = ax^2 + bx + c$
$a = 2$
$b = (2r + 3)$
$c = (2r + 1 - t)$