Find a and b.

Let the difference between the two quantities be a prime p. Then:

p = a^{2} + b - (b^{2} + a)

p = a^{2} - b^{2} - (a - b)

p = (a - b)(a + b) - (a - b)

p = (a - b)(a + b - 1)

Since the only factors of p are 1 and p, we must have:

a - b = 1

a + b - 1 = p

Adding, we get:

2a - 1 = p + 1

or

2a = p + 2

Since the right hand side must be even, p must be even.
But the only even prime is p = 2, and hence a = 2, b = 1.