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.

This page as a plain text file.
%I A068340 #41 Apr 04 2023 22:09:10
%S A068340 1,-1,-4,-4,-9,-3,-10,-10,-10,0,-11,-11,-24,-10,5,5,-12,-12,-31,-31,
%T A068340 -10,12,-11,-11,-11,15,15,15,-14,-44,-75,-75,-42,-8,27,27,-10,28,67,
%U A068340 67,26,-16,-59,-59,-59,-13,-60,-60,-60,-60,-9,-9,-62,-62,-7,-7,50,108,49
%N A068340 a(n) = Sum_{k=1..n} mu(k)*k, where mu(k) is the Moebius function.
%C A068340 Row sums of triangle A143158. - _Gary W. Adamson_, Jul 27 2008
%H A068340 Alois P. Heinz, <a href="/A068340/b068340.txt">Table of n, a(n) for n = 1..10000</a>
%F A068340 G.f. A(x) satisfies x = Sum_{k>=1} k * (1 - x^k) * A(x^k). - _Seiichi Manyama_, Apr 01 2023
%F A068340 Sum_{k=1..n} k * a(floor(n/k)) = 1. - _Seiichi Manyama_, Apr 03 2023
%p A068340 with(numtheory):
%p A068340 a:= proc(n) a(n):= mobius(n)*n +a(n-1) end: a(0):=0:
%p A068340 seq(a(n), n=1..100);  # _Alois P. Heinz_, Oct 21 2012
%t A068340 Table[Sum[MoebiusMu[k]k,{k,n}],{n,60}] (* _Harvey P. Dale_, Feb 01 2012 *)
%o A068340 (Haskell)
%o A068340 a068340 n = a068340_list !! (n-1)
%o A068340 a068340_list = scanl1 (+) a055615_list
%o A068340 -- _Reinhard Zumkeller_, Sep 04 2015
%o A068340 (PARI) a(n) = sum(k=1, n, k*moebius(k)); \\ _Michel Marcus_, Jan 14 2023
%o A068340 (Python)
%o A068340 from functools import lru_cache
%o A068340 @lru_cache(maxsize=None)
%o A068340 def A068340(n):
%o A068340     if n <= 1:
%o A068340         return 1
%o A068340     c, j = 1, 2
%o A068340     k1 = n//j
%o A068340     while k1 > 1:
%o A068340         j2 = n//k1 + 1
%o A068340         c -= (j2*(j2-1)-j*(j-1)>>1)*A068340(k1)
%o A068340         j, k1 = j2, n//j2
%o A068340     return c-(n*(n+1)-(j-1)*j>>1) # _Chai Wah Wu_, Apr 04 2023
%Y A068340 Cf. A002321, A336276, A336277, A336278, A336279.
%Y A068340 Cf. A008683, A143158, A055615, A359478, A361982.
%K A068340 sign
%O A068340 1,3
%A A068340 _Leroy Quet_, Feb 27 2002