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.

A316523 Number of odd multiplicities minus number of even multiplicities in the canonical prime factorization of n.

Original entry on oeis.org

0, 1, 1, -1, 1, 2, 1, 1, -1, 2, 1, 0, 1, 2, 2, -1, 1, 0, 1, 0, 2, 2, 1, 2, -1, 2, 1, 0, 1, 3, 1, 1, 2, 2, 2, -2, 1, 2, 2, 2, 1, 3, 1, 0, 0, 2, 1, 0, -1, 0, 2, 0, 1, 2, 2, 2, 2, 2, 1, 1, 1, 2, 0, -1, 2, 3, 1, 0, 2, 3, 1, 0, 1, 2, 0, 0, 2, 3, 1, 0, -1, 2, 1, 1
Offset: 1

Views

Author

Gus Wiseman, Jul 05 2018

Keywords

Crossrefs

Cf. A187039 (where a(n)=0). - Michel Marcus, Jul 08 2018

Programs

  • Maple
    f:= proc(n) local F;
      F:= map(t -> t[2],ifactors(n)[2]);
      2*nops(select(type,F,odd))-nops(F);
    end proc:
    map(f, [$1..100]); # Robert Israel, Aug 27 2018
  • Mathematica
    Table[Total[-(-1)^If[n==1,{},FactorInteger[n][[All,2]]]],{n,100}]
  • PARI
    a(n) = my(f=factor(n)); -sum(k=1, #f~, (-1)^(f[k,2])); \\ Michel Marcus, Jul 08 2018; corrected Jun 13 2022

Formula

If i and j are coprime, a(i*j) = a(i)+a(j). - Robert Israel, Aug 27 2018
From Amiram Eldar, Oct 05 2023: (Start)
Additive with a(p^e) = (-1)^(e+1).
a(n) = A162642(n) - A162641(n).
Sum_{k=1..n} a(k) = n * log(log(n)) + c * n + O(n/log(n)), where c = A077761 - 2*A179119 = -0.398962... . (End)