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.

A369180 Alternating sum of the k-adic valuations (ruler functions) of n.

Original entry on oeis.org

0, 1, -1, 3, -1, 1, -1, 5, -3, 1, -1, 4, -1, 1, -3, 8, -1, 0, -1, 4, -3, 1, -1, 7, -3, 1, -5, 4, -1, 1, -1, 10, -3, 1, -3, 5, -1, 1, -3, 7, -1, 1, -1, 4, -6, 1, -1, 11, -3, 0, -3, 4, -1, -1, -3, 7, -3, 1, -1, 6, -1, 1, -6, 14, -3, 1, -1, 4, -3, 1, -1, 9, -1, 1, -6, 4, -3, 1
Offset: 1

Views

Author

Friedjof Tellkamp, Jan 15 2024

Keywords

Crossrefs

Programs

  • Maple
    a:= n-> add((-1)^i*padic[ordp](n, i), i=2..n):
    seq(a(n), n=1..78);  # Alois P. Heinz, Jan 15 2024
  • Mathematica
    z = 70; Sum[(-1)^k IntegerExponent[Range[z], k], {k, 2, z}]
  • PARI
    a(n) = sum(k=2, n, (-1)^k * valuation(n,k)); \\ Michel Marcus, Jan 18 2024
    
  • PARI
    a(n)=sumdiv(n,k, if(k>1, (-1)^k * valuation(n, k))) \\ Charles R Greathouse IV, Jan 23 2025

Formula

a(n) = Sum_{k=2..n} (-1)^k * valuation(n,k).
a(n) = A007814(n) - A007949(n) + A235127(n) - (...).
G.f.: Sum_{k>=2, j>=1} (-1)^k x^(k^j)/(1-x^(k^j)).
Asymptotic mean: lim_{m->oo} (1/m) * Sum_{n=1..m} a(n) = log(2).
Dirichlet g.f.: zeta(s) * Sum_{k>=1} (1 - eta(ks)).
Sum_{n>=1} a(n)/n^2 = Pi^2/24.