We have A={1,2,3,…,10}, B={0,1,2,3,4}, and we seek the number of ordered pairs (a,b)∈A×A satisfying 2(a−b)2+3(a−b)∈B. To analyze this, set d=a−b and define f(d)=2d2+3d. We look for integer values of d such that f(d)∈B.
When d=0,f(0)=0∈B, which accounts for the 10 diagonal pairs (a,a),a=1,2,…,10.
For d=1,f(1)=5∈/B, and for d=−1,f(−1)=2−3=−1∈/B.
When d=2,f(2)=8+6=14∈/B, but for d=−2,f(−2)=8−6=2∈B. The condition a−b=−2 gives b=a+2, yielding the pairs (1,3),(2,4),…,(8,10), which are 8 in number. All other values of d produce f(d) outside of B.
In total there are 10+8=18 ordered pairs satisfying the condition. The answer is 18.