There is a systematic way to prove this.

gurpreetsingh wrote:

q^2 - 5 = 30k + r

now if we take r =0 then q can never be a perfect square as 6k+1 is never a multiple of 5.

That is not true, Eg. 25,55,85,.... are all multiples of 5 of the form 6k+1

Proof that \(q^2-5\) cannot be a multiple of 30q^2 = 30k + 5 = 6*(5k) + 5

So q^2 leaves remainder 5 when divided by 6.

Consider the various cases for the remainder that q leaves when divided by 6 :

q=6k ... q^2 will leave remainder 0 when divided by 6

q=6k+1 ... q^2 will leave remainder 1 when divided by 6

q=6k+2 ... q^2 will leave remainder 4 when divided by 6

q=6k+3 ... q^2 will leave remainder 3 when divided by 6

q=6k+4 ... q^2 will leave remainder 2 when divided by 6

q=6k+5 ... q^2 will leave remainder 1 when divided by 6

So it is not possible to have a perfect square that leaves remainder 5 when divided by 6.

So 30k+5 is not a perfect square for any choice of k.

This is a good explanation but how do you apply this on the other answers quickly?

30 is easily divided to 5 and 6. but what about 41 or 29? you have to think about a number which these numbers are multiplied by and than add 5 which is a perfect square. Not trivial at all I think.