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}.

Original entry on oeis.org

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, 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, 1, 1, 0, 2, 0, 0, 2, 1, 0, 1, 0, 2, 1, 0, 0, 2, 1, 0, 1, 1, 0, 2
Offset: 1

Views

Author

Wesley Ivan Hurt, Oct 30 2023

Keywords

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].

Examples

			a(12) = 2 since exactly two of its divisors are members of the set {3,4,5}.
		

Crossrefs

Programs

  • 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 *)
  • 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

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