Keep it back a bit. This is why:
In short:
Having the fan directly at the window expels the amount of air the fan moves, at the speed the fan moves it. This amount times this speed gives you x volume pr unit of time.
Having the fan back a bit, expels the air the fan moves PLUS a significant amount of air around it (since air is “sticky” – look up “laminar flow vs turbulent flow over aircraft wings” for instance). This reduces the speed of which the air os beeing ejected, but not by as large a factor as the volume being moved is increased. As such, this y volume pr unit time is significantly higher than in the first case, all other things being equal.
Latest Answers