R, 152 138137 bytes
-12 bytes thanks to Giuseppe -23 bytes thanks to digEmAll
n=scan()
F=i=!1:2
`?`=sum
while(?n>i)if(n==?(i[s]=i[s<-sign((?!(r=revr=?rev((T=T+1)%/%(e=10^(0:log10(T)))%%10)%*%e*e)%%1:r)-?!T%%1:T)]+1))F[s]=T
F
T
is the integer currently being tried; the latest poor and rich numbers are stored in the vector F
.
The shortest way I could find of reversing an integer was converting it to digits in base 10 with modular arithmetic, then converting back with powers of 10 inverted, but I expect to be outgolfed on this and other fronts.
Explanation (of previous, similar version):
n=scan() # input
i=0*1:3 # number of poor, middle class, and rich numbers so far
S=sum
while(S(n>i)){ # continue as long as at least one of the classes has less than n numbers
if((i[s]=i[
s<-2+sign(S(!( # s will be 1 for poor, 2 for middle class, 3 for rich
r=S((T<-T+1)%/%10^(0:( # reverse integer T with modular arithmetic
b=log10(T)%/%1 # b is number of digits
))%%10*10^(b:0))
)%%1:r)- # compute number of divisors of r
S(!T%%1:T)) # computer number of divisors of T
]+1)<=n){ # check we haven't already found n of that class
F[s]=T
}
}
F[-2] # print nth poor and rich numbers