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.

A378221 Dirichlet inverse of sigma(A003961(n)), where A003961 is fully multiplicative function with a(prime(i)) = prime(i+1).

Original entry on oeis.org

1, -4, -6, 3, -8, 24, -12, 0, 5, 32, -14, -18, -18, 48, 48, 0, -20, -20, -24, -24, 72, 56, -30, 0, 7, 72, 0, -36, -32, -192, -38, 0, 84, 80, 96, 15, -42, 96, 108, 0, -44, -288, -48, -42, -40, 120, -54, 0, 11, -28, 120, -54, -60, 0, 112, 0, 144, 128, -62, 144, -68, 152, -60, 0, 144, -336, -72, -60, 180, -384, -74, 0
Offset: 1

Views

Author

Antti Karttunen, Nov 23 2024

Keywords

Crossrefs

Dirichlet inverse of A003973.

Programs

  • Mathematica
    f[p_, e_] := Which[e == 1, -NextPrime[p]-1, e == 2, NextPrime[p], e >= 3, 0]; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Jan 12 2025 *)
  • PARI
    A378221(n) = { my(f=factor(n)~); prod(i=1, #f, if(1==f[2,i], -(nextprime(1+f[1,i])+1), if(2==f[2,i], nextprime(1+f[1,i]), 0))); };
    
  • Python
    from math import prod
    from sympy import nextprime, factorint
    def A378221(n): return 0 if any(map(lambda x:x>2,(f:=factorint(n)).values())) else prod(-nextprime(p)-1 if e&1 else nextprime(p) for p,e in f.items()) # Chai Wah Wu, Nov 23 2024

Formula

Multiplicative with a(p) = -q-1, a(p^2) = q, a(p^k) = 0 for k > 2, where q = A151800(p), the least prime > p.
a(n) = A046692(A003961(n)).