Engineer, not jet pilot response
The objective is to stay airborne for as long as possible at a constant ALT and KTAS.
This will be achieved by picking the speed and altitude that results in the lowest average fuel flow.
As fuel is burnt off, an ever lower fuel flow will maintain the set ALT and KTAS.
So the problem is surely to find the ALT and KTAS with the lowest fuel flow at which the plane can just remain airborne at its initial weight?
Problem is complicated slightly by fuel used to get to the initial setting and glide time after fuel exhaustion, but I would have thought these considerations wouldn't significantly change the answer.