%I #28 Sep 08 2022 08:45:33
%S 1,2,1,1,1,2,1,3,2,2,1,4,1,2,1,1,1,4,1,2,1,2,1,4,1,2,1,2,1,2,1,2,1,2,
%T 1,3,1,2,1,4,1,2,1,2,2,2,1,2,1,2,1,2,1,2,1,4,1,2,1,6,1,2,2,1,1,2,1,2,
%U 1,2,1,6,1,2,2,2,1,2,1,4,1,2,1,6,1,2,1,4,1,4,1,2,1,2,1,6,1,2,2,1,1,2,1,4,1,2,1,6,1,2,1,2,1,2,1,2,2,2,1,4
%N a(n) is the number of positive divisors of n that divide d(n), where d(n) is the number of positive divisors of n, A000005(n); a(n) also equals d(gcd(n, d(n))).
%H Antti Karttunen, <a href="/A138010/b138010.txt">Table of n, a(n) for n = 1..10000</a>
%F a(n) = A000005(A009191(n)). [From the alternative description.] - _Antti Karttunen_, May 25 2017
%e 12 has 6 divisors (1,2,3,4,6,12). Those divisors of 12 that divide 6 are 1,2,3,6. Since there are 4 of these, then a(12) = 4.
%p with(numtheory): a:=proc(n) local div,c,j: div:=divisors(n): c:=0: for j to tau(n) do if `mod`(tau(n), div[j])=0 then c:=c+1 else end if end do: c end proc: seq(a(n),n=1..90); # _Emeric Deutsch_, Mar 02 2008
%t Table[Length[Select[Divisors[n], Mod[Length[Divisors[n]], # ] == 0 &]], {n,1,100}] (* _Stefan Steinerberger_, Feb 29 2008 *)
%t Table[Count[DivisorSigma[0,n]/Divisors[n],_?IntegerQ],{n,120}] (* _Harvey P. Dale_, May 31 2019 *)
%o (PARI) A138010(n) = sumdiv(n,d,if(!(numdiv(n)%d), 1, 0)); \\ _Antti Karttunen_, May 25 2017
%o (Scheme) (define (A138010 n) (A000005 (gcd n (A000005 n)))) ;; _Antti Karttunen_, May 25 2017
%o (Python)
%o from sympy import divisors, divisor_count
%o def a(n): return sum([ 1*(divisor_count(n)%d==0) for d in divisors(n)]) # _Indranil Ghosh_, May 25 2017
%o (Magma) [#Divisors( Gcd(n,#Divisors(n))):n in [1..120]]; // _Marius A. Burtea_, Aug 03 2019
%Y Cf. A000005, A009191, A124315, A138011, A138012.
%K nonn
%O 1,2
%A _Leroy Quet_, Feb 27 2008
%E More terms from _Stefan Steinerberger_ and _Emeric Deutsch_, Feb 29 2008
%E Further extended (to 120 terms) by _Antti Karttunen_, May 25 2017