Original version is missing the max K by an amount dk. As N increases you get closer to the endpoint it becomes closer, but typically the max is somewhat important. I noticed this when trying to pull the max from N=2 where dk is large which was not giving the correct result. Suggest also checking for N=1 with different min/max.
Original version is missing the max K by an amount dk. As N increases you get closer to the endpoint it becomes closer, but typically the max is somewhat important. I noticed this when trying to pull the max from N=2 where dk is large which was not giving the correct result. Suggest also checking for N=1 with different min/max.