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.

A349341 Dirichlet inverse of A026741, which is defined as n if n is odd, n/2 if n is even.

Original entry on oeis.org

1, -1, -3, -1, -5, 3, -7, -1, 0, 5, -11, 3, -13, 7, 15, -1, -17, 0, -19, 5, 21, 11, -23, 3, 0, 13, 0, 7, -29, -15, -31, -1, 33, 17, 35, 0, -37, 19, 39, 5, -41, -21, -43, 11, 0, 23, -47, 3, 0, 0, 51, 13, -53, 0, 55, 7, 57, 29, -59, -15, -61, 31, 0, -1, 65, -33, -67, 17, 69, -35, -71, 0, -73, 37, 0, 19, 77, -39, -79
Offset: 1

Views

Author

Antti Karttunen, Nov 15 2021

Keywords

Crossrefs

Agrees with A349343 on odd numbers.

Programs

  • Mathematica
    a[1]=1;a[n_]:=-DivisorSum[n,If[OddQ[n/#],n/#,n/(2#)]*a@#&,#Giorgos Kalogeropoulos, Nov 15 2021 *)
    f[p_, e_] := If[e == 1, -p, 0]; f[2, e_] := -1; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Sep 18 2023 *)
  • PARI
    A349341(n) = { my(f = factor(n)); prod(i=1, #f~, if(2==f[i,1], -1, if(1==f[i,2], -f[i,1], 0))); };
    
  • Python
    from sympy import prevprime, factorint, prod
    def f(p, e):
        return -1 if p == 2 else 0 if e > 1 else -p
    def a(n):
        return prod(f(p, e) for p, e in factorint(n).items()) # Sebastian Karlsson, Nov 15 2021

Formula

a(1) = 1; a(n) = -Sum_{d|n, d < n} A026741(n/d) * a(d).
a(n) = A349342(n) - A026741(n).
a(2n+1) = A349343(2n+1) for all n >= 1.
Multiplicative with a(2^e) = -1, a(p) = -p and a(p^e) = 0 if e > 1. - Sebastian Karlsson, Nov 15 2021