there are n numbers each of the form 3n,3n+1,3n+2...
x+y is divisible by 3 in two cases
first when x and y are both of the form 3n and the other when one of them is of the form 3n+1 and the other of the form 3n+2....
for the first case.....
x and y can be chosen in nC2 ways
for the second case:
x and y both can be chosen in n ways.....
so total favourable events=nC2+n2
sample space=3nC2
therefore probability=nC2+n23nC2