%I #31 Feb 16 2025 08:34:00
%S 1,2,1,2,1,2,1,3,2,2,1,3,1,2,1,3,1,4,1,2,1,2,1,5,1,2,2,2,1,2,1,3,1,2,
%T 1,6,1,2,1,4,1,2,1,2,2,2,1,5,1,2,1,2,1,4,1,4,1,2,1,4,1,2,2,3,1,2,1,2,
%U 1,2,1,9,1,2,1,2,1,2,1,5,2,2,1,4,1,2,1,4,1,4,1,2
%N Number of refactorable divisors of n.
%C Inverse Möbius transform of A336040. - _Antti Karttunen_, Nov 24 2021
%H Antti Karttunen, <a href="/A336041/b336041.txt">Table of n, a(n) for n = 1..65537</a>
%H Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/RefactorableNumber.html">Refactorable Number</a>
%F a(n) = Sum_{d|n} c(d), where c(n) is the refactorable characteristic of n (A336040).
%F a(n) = Sum_{d|n} (1 - ceiling(d/tau(d)) + floor(d/tau(d))), where tau(n) is the number of divisors of n (A000005).
%F a(n) = A000005(n) - A349658(n). - _Antti Karttunen_, Nov 24 2021
%F a(p) = 1 for odd primes p. - _Wesley Ivan Hurt_, Nov 28 2021
%e a(6) = 2; The divisors of 6 are {1,2,3,6}. Only two of these divisors are refactorable since d(1) = 1|1 and d(2) = 2|2, but d(3) = 2 does not divide 3 and d(6) = 4 does not divide 6.
%e a(7) = 1; The divisors of 7 are {1,7} and d(1) = 1|1, but d(7) = 2 does not divide 7, so a(7) = 1.
%e a(8) = 3; The divisors of 8 are {1,2,4,8}. 1, 2 and 8 are refactorable since d(1) = 1|1, d(2) = 2|2 and d(8) = 4|8 but d(4) = 3 does not divide 4, so a(8) = 3.
%e a(9) = 2; The divisors of 9 are {1,3,9}. 1 and 9 are refactorable since d(1) = 1|1 and d(9) = 3|9 but d(3) = 2 does not divide 3. Thus, a(9) = 2.
%p A336041 := proc(n)
%p local a ;
%p a := 0 ;
%p for d in numtheory[divisors](n) do
%p if type(d/numtheory[tau](d),integer) then
%p a := a+1 ;
%p end if;
%p end do:
%p a ;
%p end proc:
%p seq(A336041(n),n=1..30) ; # _R. J. Mathar_, Nov 24 2020
%t a[n_] := DivisorSum[n, 1 &, Divisible[#, DivisorSigma[0, #]] &]; Array[a, 100] (* _Amiram Eldar_, Jul 08 2020 *)
%o (PARI) a(n) = sumdiv(n, d, d%numdiv(d) == 0); \\ _Michel Marcus_, Jul 07 2020
%Y Cf. A000005 (tau), A033950 (refactorable numbers), A336040 (refactorable characteristic), A349658 (number of nonrefactorable divisors).
%Y Cf. also A335182, A335665.
%K nonn,easy
%O 1,2
%A _Wesley Ivan Hurt_, Jul 07 2020