%I #9 Aug 06 2024 05:41:27
%S 0,0,0,1,0,0,0,2,1,0,0,1,0,0,0,3,0,1,0,1,1,0,0,2,1,0,2,1,0,0,0,4,0,0,
%T 1,3,0,0,1,2,0,1,0,1,1,0,0,3,1,2,0,1,0,2,1,2,1,0,0,1,0,0,3,5,1,0,0,1,
%U 0,1,0,4,0,0,2,1,1,1,0,3,3,0,0,2,1,0,0,2
%N a(n) is the number of divisors of n that are Duffinian numbers (A003624).
%F a(p^k)) = k - 1, for p prime and k >= 1.
%e Since A003624(1) = 4 then a(1) = a(2) = a(3) = 0 and a(4) = 1.
%e a(8) = 2 because 8 has the divisors 4 = A003624(1) and 8 = A003624(2).
%t a[n_] := DivisorSum[n, 1 &, CompositeQ[#] && CoprimeQ[#, DivisorSigma[1, #]] &]; Array[a, 100] (* _Amiram Eldar_, Jul 19 2024 *)
%o (Magma) f:=func<n|n ne 1 and not IsPrime(n) and Gcd(n,DivisorSigma(1,n)) eq 1>; [#[d:d in Divisors(k)|f(d)]:k in [1..100]];
%Y Cf. A000203, A003624, A009194.
%K nonn
%O 1,8
%A _Marius A. Burtea_, Jul 12 2024