%I #18 Nov 13 2023 08:44:58
%S 0,0,1,1,1,1,0,1,1,1,0,2,0,0,2,1,0,1,0,2,1,0,0,2,1,0,1,1,0,2,0,1,1,0,
%T 1,2,0,0,1,2,0,1,0,1,2,0,0,2,0,1,1,1,0,1,1,1,1,0,0,3,0,0,1,1,1,1,0,1,
%U 1,1,0,2,0,0,2,1,0,1,0,2,1,0,0,2,1,0,1,1,0,2
%N Number of divisors of n in the set {3,4,5}.
%C If n is even and a(n) > 0, then n can be written as the sum of 4 divisors of n (not necessarily distinct). For example, 6 = 1+2+1+2 and 12 = 3+3+3+3 but 14 cannot be written as the sum of 4 of its divisors since 14 is even, but a(14) = 0. [See discussion in A354591].
%F a(n) = Sum_{d|n, d = 3, 4, or 5} 1.
%F a(n) = Sum_{d|n} ([d = 3] + [d = 4] + [d = 5]), where [ ] is the Iverson bracket.
%F a(n) = Sum_{d|n} Sum_{k=3..5} [d = k], where [ ] is the Iverson bracket.
%F Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 47/60. - _Amiram Eldar_, Nov 12 2023
%e a(12) = 2 since exactly two of its divisors are members of the set {3,4,5}.
%t Table[Sum[Sum[KroneckerDelta[k, j], {j, 3, 5}] (1 - Ceiling[n/k] + Floor[n/k]), {k, n}], {n, 100}]
%t a[n_] := Total[Sign[IntegerExponent[n, {3, 4, 5}]]]; Array[a, 100] (* _Amiram Eldar_, Nov 12 2023 *)
%o (PARI) a(n) = sumdiv(n, d, (d>=3) && (d<=5)); \\ _Michel Marcus_, Nov 11 2023
%o (PARI) a(n) = (valuation(n,3)>0) + (valuation(n,2)>1) + (valuation(n,5)>0); \\ _Amiram Eldar_, Nov 12 2023
%o (Python)
%o def A366981(n): return sum(int(not n%d) for d in range(3,6)) # _Chai Wah Wu_, Nov 12 2023
%Y Cf. A080671, A354591.
%K nonn,easy
%O 1,12
%A _Wesley Ivan Hurt_, Oct 30 2023