cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A366981 Number of divisors of n in the set {3,4,5}.

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