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.

Showing 1-2 of 2 results.

A385128 The number of divisors of n whose maximum exponent in their prime factorization is even.

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 1, 2, 2, 1, 1, 3, 1, 1, 1, 3, 1, 3, 1, 3, 1, 1, 1, 3, 2, 1, 2, 3, 1, 1, 1, 3, 1, 1, 1, 6, 1, 1, 1, 3, 1, 1, 1, 3, 3, 1, 1, 5, 2, 3, 1, 3, 1, 3, 1, 3, 1, 1, 1, 5, 1, 1, 3, 4, 1, 1, 1, 3, 1, 1, 1, 6, 1, 1, 3, 3, 1, 1, 1, 5, 3, 1, 1, 5, 1, 1, 1
Offset: 1

Views

Author

Amiram Eldar, Jun 24 2025

Keywords

Comments

The number of terms in A368714 that divide n.
The sum of these divisors is A385130(n).

Crossrefs

Programs

  • Mathematica
    q[n_] := EvenQ[Max[FactorInteger[n][[;; , 2]]]]; q[1] = True; a[n_] := DivisorSum[n, 1 &, q[#] &]; Array[a, 100]		
    (* second program: *)
    a[n_] := Module[{e = FactorInteger[n][[;;, 2]], emax, kmax}, emax = Max[e]; kmax = emax + 1 - Mod[emax, 2]; Sum[(-1)^(k+1) * Product[Min[e[[i]], k-1] + 1, {i, 1, Length[e]}], {k, 1, kmax}]]; Array[a, 100]
  • PARI
    q(n) = if(n == 1, 1, !(vecmax(factor(n)[,2]) % 2));
    a(n) = sumdiv(n, d, q(d));
    
  • PARI
    a(n) = if(n == 1, 1, my(e = factor(n)[,2], emax = vecmax(e), kmax = emax + 1 - emax %2); sum(k = 1, kmax, (-1)^(k+1) * prod(i = 1, #e, min(e[i], k-1)+1)));

Formula

a(n) = Sum_{d|n} (1 - A051903(d) mod 2).
a(n) = A000005(n) - A385129(n).
a(n) = Sum_{k=1..kmax(n)} (-1)^(k+1) * Product_{i=1..r} (min(e_i, k-1) + 1), for n >= 2; if n = Product_{i=1..r} p_i^e_i, r = omega(n) = A001221(n), then emax(n) = max(e_i) = A051903(n), and kmax(n) = emax(n) if emax(n) is odd, and emax(n)+1 otherwise.
Sum_{k=1..n} a(k) ~ c1 * n * (log(n) + 2*gamma - 1) + c2 * n, where gamma is Euler's constant (A001620), c1 = Sum_{k>=2} (-1)^k * (1-1/zeta(k)) = 0.27591672059822700769..., and c2 = 1 + Sum_{k>=2} (-1)^k * k * zeta'(k)/zeta(k)^2 = 0.56812633046434345687... .

A385131 The sum of divisors of n whose maximum exponent in their prime factorization is odd.

Original entry on oeis.org

0, 2, 3, 2, 5, 11, 7, 10, 3, 17, 11, 11, 13, 23, 23, 10, 17, 11, 19, 17, 31, 35, 23, 43, 5, 41, 30, 23, 29, 71, 31, 42, 47, 53, 47, 11, 37, 59, 55, 65, 41, 95, 43, 35, 23, 71, 47, 43, 7, 17, 71, 41, 53, 92, 71, 87, 79, 89, 59, 71, 61, 95, 31, 42, 83, 143, 67, 53
Offset: 1

Views

Author

Amiram Eldar, Jun 24 2025

Keywords

Comments

The sum of divisors of n that are not terms in A368714.
The number of these divisors is A385129(n).

Crossrefs

Programs

  • Mathematica
    q[n_] := OddQ[Max[FactorInteger[n][[;; , 2]]]]; q[1] = False; a[n_] := DivisorSum[n, # &, q[#] &]; Array[a, 100]		
    (* second program: *)
    a[n_] := Module[{f = FactorInteger[n], p, e, emax, kmax}, p = f[[;;,1]]; e = f[[;;,2]]; emax = Max[e]; kmax = emax + Mod[emax, 2]; Sum[(-1)^k * Product[(p[[i]]^(Min[e[[i]], k-1]+1)-1)/(p[[i]]-1), {i, 1, Length[e]}], {k, 1, kmax}]]; a[1] = 0; Array[a, 100]
  • PARI
    q(n) = if(n == 1, 0, vecmax(factor(n)[,2]) % 2);
    a(n) = sumdiv(n, d, d*q(d));
    
  • PARI
    a(n) = if(n == 1, 0, my(f = factor(n), p = f[,1], e = f[,2], emax = vecmax(e), kmax = emax + emax % 2); sum(k = 1, kmax, (-1)^k * prod(i = 1, #e, (p[i]^(min(e[i], k-1)+1)-1)/(p[i]-1))));

Formula

a(n) = Sum_{d|n} (d * (A051903(d) mod 2)).
a(n) = A000203(n) - A385130(n).
a(n) = Sum_{k=1..kmax(n)} (-1)^k * Product_{i=1..r} (p_i^(min(e_i, k-1) + 1)-1)/(p_i-1), for n >= 2; if n = Product_{i=1..r} p_i^e_i, r = omega(n) = A001221(n), then emax(n) = max(e_i) = A051903(n), and kmax(n) = emax(n)+1 if emax(n) is odd, and emax(n) otherwise.
Sum_{k=1..n} a(k) ~ c * zeta(2) * n^2 / 2, where c = 1 - Sum_{k>=2} (-1)^k * (1-1/zeta(k)) = 0.7240832794017729923099...,
Showing 1-2 of 2 results.