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.

A145378 a(n) = Sum_{d|n} sigma(d) - 2*Sum_{2c|n} sigma(c) + 4*Sum_{4b|n} sigma(b).

Original entry on oeis.org

1, 2, 5, 7, 7, 10, 9, 20, 18, 14, 13, 35, 15, 18, 35, 49, 19, 36, 21, 49, 45, 26, 25, 100, 38, 30, 58, 63, 31, 70, 33, 110, 65, 38, 63, 126, 39, 42, 75, 140, 43, 90, 45, 91, 126, 50, 49, 245, 66, 76, 95, 105, 55, 116, 91, 180, 105, 62, 61, 245, 63, 66, 162, 235, 105, 130, 69
Offset: 1

Views

Author

N. J. A. Sloane, Mar 12 2009

Keywords

Comments

Dirichlet convolution of [1,-2,0,4,0,0,0,...] with A007429.

Crossrefs

Programs

  • Maple
    with(numtheory); g:=proc(n) local d,c,b,t0,t1,t2,t3;
    t1:=divisors(n);
    t0:=add( sigma(d), d in t1);
    t2:=0; for d in t1 do if d mod 2 = 0 then t2:=t2+sigma(d/2); fi; od:
    t3:=0; for d in t1 do if d mod 4 = 0 then t3:=t3+sigma(d/4); fi; od:
    t0-2*t2+4*t3; end;
    [seq(g(n),n=1..100)];
    # alternative
    read("transforms") : nmax := 100 :
    L27 := [seq(i,i=1..nmax) ];
    L := [1,-2,0,4,seq(0,i=1..nmax)] ;
    DIRICHLET(L27,L) :
    MOBIUSi(%) :
    MOBIUSi(%) ; # R. J. Mathar, Sep 25 2017
  • Mathematica
    a[n_] := Sum[DivisorSigma[1, d] - 2 Boole[Mod[d, 2] == 0] DivisorSigma[1, d/2] + 4 Boole[Mod[d, 4] == 0] DivisorSigma[1, d/4], {d, Divisors[n]}];
    Array[a, 100] (* Jean-François Alcover, Apr 04 2020 *)
    f[p_, e_] := (p*(p^(e + 1) - 1) - (p - 1)*(e + 1))/(p - 1)^2; f[2, e_] := 2^(e + 2) - 3*(e + 1); a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Oct 25 2022 *)
  • PARI
    a(n) = {my(f = factor(n)); prod(i = 1, #f~, if(f[i,1] == 2, 2^(f[i,2]+2) - 3*(f[i,2]+1),  (f[i,1]*(f[i,1]^(f[i,2]+1)-1) - (f[i,1]-1)*(f[i,2]+1))/(f[i,1]-1)^2)); } \\ Amiram Eldar, Oct 25 2022

Formula

Dirichlet g.f.: (1-2/2^s+4/4^s)*(zeta(s))^2*zeta(s-1).
From Amiram Eldar, Oct 25 2022: (Start)
Multiplicative with a(2^e) = 2^(e+2) - 3*(e+1) and a(p^e) = (p*(p^(e+1)-1) - (p-1)*(e+1))/(p-1)^2 if p > 2.
Sum_{k=1..n} a(k) ~ c * n^2, where c = Pi^4/96 = 1.01467803... (A300707). (End)