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.

A328258 a(n) = Sum_{d|n, gcd(d,n/d) = 1} (-1)^(d + 1) * d.

Original entry on oeis.org

1, -1, 4, -3, 6, -4, 8, -7, 10, -6, 12, -12, 14, -8, 24, -15, 18, -10, 20, -18, 32, -12, 24, -28, 26, -14, 28, -24, 30, -24, 32, -31, 48, -18, 48, -30, 38, -20, 56, -42, 42, -32, 44, -36, 60, -24, 48, -60, 50, -26, 72, -42, 54, -28, 72, -56, 80, -30, 60, -72, 62, -32, 80, -63, 84
Offset: 1

Views

Author

Ilya Gutkovskiy, Oct 09 2019

Keywords

Comments

Excess of sum of odd unitary divisors of n over sum of even unitary divisors of n.
a(n) = n+1 iff n is in A061345 \ {1}. - Bernard Schott, Mar 05 2023

Crossrefs

Programs

  • Magma
    [&+[(-1)^(d+1)*d:d in Divisors(n)|Gcd(d, n div d) eq 1]:n in [1..70]]; // Marius A. Burtea, Oct 10 2019
    
  • Maple
    f:= proc(n) local t;
      mul(1 - (-1)^t[1] * t[1]^t[2], t=ifactors(n)[2])
    end proc:
    map(f, [$1..100]); # Robert Israel, Oct 10 2019
  • Mathematica
    a[n_] := Sum[Boole[GCD[d, n/d] == 1] (-1)^(d + 1) d, {d, Divisors[n]}]; Table[a[n], {n, 1, 65}]
    a[1] = 1; a[n_] := Times @@ (1 - (-1)^First[#] First[#]^Last[#] & /@ FactorInteger[n]); Table[a[n], {n, 1, 65}]
  • PARI
    a(n) = sumdiv(n, d, if (gcd(d,n/d) == 1, (-1)^(d + 1) * d)); \\ Michel Marcus, Oct 10 2019

Formula

If n = Product (p_j^k_j) then a(n) = Product (1 - (-1)^p_j * p_j^k_j).
If n odd, a(n) = usigma(n), where usigma = A034448.
Sum_{k=1..n} a(k) ~ c * n^2, where c = zeta(2)/(14*zeta(3)) = A306633 / 14 = 0.0977451... . - Amiram Eldar, Nov 17 2022
From Amiram Eldar, Jan 28 2023: (Start)
a(n) = 2 * A192066(n) - A034448(n).
a(n) = A192066(n) - A360156(n/2) if n is even, and A192066(n) otherwise.
Dirichlet g.f.: (zeta(s)*zeta(s-1)/zeta(2*s-1))*(2^(2*s)-2^(s+2)+2)/(2^(2*s)-2). (End)