I'd recommend using the ticket office at Gatwick rather than the machines - they offer a baffling array of fares, and it's hard to work out what you really need. (They completely threw me yesterday, and I thought I understood train ticketing in the UK...)