As #2a9b1# is a five digit number and perfect square, the number is a #3# digit number and as unit digit is #1# in the square, in square root, we have either #1# or #9# as units digit (as other digits will not make unit digit #1#).

Further as first digit in square #2a9b1#, in the place of ten-thousand is #2#, we must have #1# in hundreds 'place in square root. Further as first three digits are #2a9# and #sqrt209>14# and #sqrt299<=17#.

Hence, numbers can only be #149#, #151#, #159#, #161#, #169#, #171# as for #141# and #179#, squares will have #1# or #3# in ten thousands place.

Of these only #161^2=25921# falls as per pattern #2a9b1# and hence #a=5# and #b=2# and hence

#a^(b-1)+b^(a-1)=5^(2-1)+2^(5-1)=5^1+2^4=5+16=21#