OFFSET
1,12
COMMENTS
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].
FORMULA
a(n) = Sum_{d|n, d = 3, 4, or 5} 1.
a(n) = Sum_{d|n} ([d = 3] + [d = 4] + [d = 5]), where [ ] is the Iverson bracket.
a(n) = Sum_{d|n} Sum_{k=3..5} [d = k], where [ ] is the Iverson bracket.
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 47/60. - Amiram Eldar, Nov 12 2023
EXAMPLE
a(12) = 2 since exactly two of its divisors are members of the set {3,4,5}.
MATHEMATICA
Table[Sum[Sum[KroneckerDelta[k, j], {j, 3, 5}] (1 - Ceiling[n/k] + Floor[n/k]), {k, n}], {n, 100}]
a[n_] := Total[Sign[IntegerExponent[n, {3, 4, 5}]]]; Array[a, 100] (* Amiram Eldar, Nov 12 2023 *)
PROG
(PARI) a(n) = sumdiv(n, d, (d>=3) && (d<=5)); \\ Michel Marcus, Nov 11 2023
(PARI) a(n) = (valuation(n, 3)>0) + (valuation(n, 2)>1) + (valuation(n, 5)>0); \\ Amiram Eldar, Nov 12 2023
(Python)
def A366981(n): return sum(int(not n%d) for d in range(3, 6)) # Chai Wah Wu, Nov 12 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Oct 30 2023
STATUS
approved