login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A068340 a(n) = Sum_{k=1..n} mu(k)*k, where mu(k) is the Moebius function. 17

%I #41 Apr 04 2023 22:09:10

%S 1,-1,-4,-4,-9,-3,-10,-10,-10,0,-11,-11,-24,-10,5,5,-12,-12,-31,-31,

%T -10,12,-11,-11,-11,15,15,15,-14,-44,-75,-75,-42,-8,27,27,-10,28,67,

%U 67,26,-16,-59,-59,-59,-13,-60,-60,-60,-60,-9,-9,-62,-62,-7,-7,50,108,49

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

%C Row sums of triangle A143158. - _Gary W. Adamson_, Jul 27 2008

%H Alois P. Heinz, <a href="/A068340/b068340.txt">Table of n, a(n) for n = 1..10000</a>

%F G.f. A(x) satisfies x = Sum_{k>=1} k * (1 - x^k) * A(x^k). - _Seiichi Manyama_, Apr 01 2023

%F Sum_{k=1..n} k * a(floor(n/k)) = 1. - _Seiichi Manyama_, Apr 03 2023

%p with(numtheory):

%p a:= proc(n) a(n):= mobius(n)*n +a(n-1) end: a(0):=0:

%p seq(a(n), n=1..100); # _Alois P. Heinz_, Oct 21 2012

%t Table[Sum[MoebiusMu[k]k,{k,n}],{n,60}] (* _Harvey P. Dale_, Feb 01 2012 *)

%o (Haskell)

%o a068340 n = a068340_list !! (n-1)

%o a068340_list = scanl1 (+) a055615_list

%o -- _Reinhard Zumkeller_, Sep 04 2015

%o (PARI) a(n) = sum(k=1, n, k*moebius(k)); \\ _Michel Marcus_, Jan 14 2023

%o (Python)

%o from functools import lru_cache

%o @lru_cache(maxsize=None)

%o def A068340(n):

%o if n <= 1:

%o return 1

%o c, j = 1, 2

%o k1 = n//j

%o while k1 > 1:

%o j2 = n//k1 + 1

%o c -= (j2*(j2-1)-j*(j-1)>>1)*A068340(k1)

%o j, k1 = j2, n//j2

%o return c-(n*(n+1)-(j-1)*j>>1) # _Chai Wah Wu_, Apr 04 2023

%Y Cf. A002321, A336276, A336277, A336278, A336279.

%Y Cf. A008683, A143158, A055615, A359478, A361982.

%K sign

%O 1,3

%A _Leroy Quet_, Feb 27 2002

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 16 08:21 EDT 2024. Contains 371698 sequences. (Running on oeis4.)