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.

A068340 a(n) = Sum_{k=1..n} mu(k)*k, where mu(k) is the Moebius function.

Original entry on oeis.org

1, -1, -4, -4, -9, -3, -10, -10, -10, 0, -11, -11, -24, -10, 5, 5, -12, -12, -31, -31, -10, 12, -11, -11, -11, 15, 15, 15, -14, -44, -75, -75, -42, -8, 27, 27, -10, 28, 67, 67, 26, -16, -59, -59, -59, -13, -60, -60, -60, -60, -9, -9, -62, -62, -7, -7, 50, 108, 49
Offset: 1

Views

Author

Leroy Quet, Feb 27 2002

Keywords

Comments

Row sums of triangle A143158. - Gary W. Adamson, Jul 27 2008

Crossrefs

Programs

  • Haskell
    a068340 n = a068340_list !! (n-1)
    a068340_list = scanl1 (+) a055615_list
    -- Reinhard Zumkeller, Sep 04 2015
    
  • Maple
    with(numtheory):
    a:= proc(n) a(n):= mobius(n)*n +a(n-1) end: a(0):=0:
    seq(a(n), n=1..100);  # Alois P. Heinz, Oct 21 2012
  • Mathematica
    Table[Sum[MoebiusMu[k]k,{k,n}],{n,60}] (* Harvey P. Dale, Feb 01 2012 *)
  • PARI
    a(n) = sum(k=1, n, k*moebius(k)); \\ Michel Marcus, Jan 14 2023
    
  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def A068340(n):
        if n <= 1:
            return 1
        c, j = 1, 2
        k1 = n//j
        while k1 > 1:
            j2 = n//k1 + 1
            c -= (j2*(j2-1)-j*(j-1)>>1)*A068340(k1)
            j, k1 = j2, n//j2
        return c-(n*(n+1)-(j-1)*j>>1) # Chai Wah Wu, Apr 04 2023

Formula

G.f. A(x) satisfies x = Sum_{k>=1} k * (1 - x^k) * A(x^k). - Seiichi Manyama, Apr 01 2023
Sum_{k=1..n} k * a(floor(n/k)) = 1. - Seiichi Manyama, Apr 03 2023