It's a long time since I went to school!
I'm sure that someone will be able to give you the theory behind the answers Graeme. In the meantime, I've worked out a couple of patterns that might help you.
The last digit on every line is equal to that line number squared ie line 2 ends with the number 4, line 5 ends with the number 25.
You should therefore be able to work out what line numbers 100 and 1000 are on.
The number directly below another is always the line number of the first no. multiplied by 2 plus the first number ie 3 is on line 2 therefore the number below it is 2(line no) x 2 + 3(first no) = 7. (I think!)
Hopefully (for your sake) in the time it's taken me to type this in, someone else will have posted the answer for you!!!!!!

Good luck