%I #10 Mar 15 2023 10:54:49
%S 3,6,15,28,165,30,135,48,144,192,1755,300,1485,270,2079,336,6237,1008,
%T 9639,1728,1296,3510,28215,1080,16900,2970,10395,7840,12285,4158,
%U 41055,4752,40425,12474,48195,3780,220077,19278,51975,10920,356265,9450
%N Least m such that n = m mod tau(m) if such m exists, otherwise 0.
%C By definition, a(n) >= n. If the condition is changed to n == m mod tau(m), then a(n) = 1 for all n. - _Chai Wah Wu_, Mar 14 2023
%H Chai Wah Wu, <a href="/A066708/b066708.txt">Table of n, a(n) for n = 1..270</a>
%t Module[{nn=500000,mtm},mtm=Table[{m,Mod[m,DivisorSigma[0,m]]},{m,nn}];Table[ SelectFirst[mtm,#[[2]]==n&],{n,50}]][[All,1]] (* _Harvey P. Dale_, Jan 10 2023 *)
%o (Python)
%o from itertools import count
%o from sympy import divisor_count
%o def A066708(n): return next(filter(lambda m:m%divisor_count(m)==n,count(n))) # _Chai Wah Wu_, Mar 14 2023
%Y Cf. A000005.
%K nonn
%O 1,1
%A _Vladeta Jovovic_, Jan 14 2002