Below is a code taken from OEIS that generates integers $n$ such that $\sigma(n)-n\mid (n-1)$.
Select[ Range[2, 250] , Divisible[#-1, DivisorSigma[1, #]-#]& ]
How can I modify this code in such a way that I only get a particular subset of the generated sequence. The subset I want to get are the perfect squares among those $n$ that are generated above.
Thanks for your help in advance.