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!)
A344429 a(n) = Sum_{k=1..n} mu(k) * k^n. 4

%I #24 Nov 04 2023 06:40:55

%S 1,-3,-34,-96,-3399,30239,-624046,-4482626,-32249230,9768165230,

%T -186975207617,-2150337557747,-327482869358214,6894274639051756,

%U 539094536846680025,8044964790023844733,-707278869236116107432,-12275330572755863672628,-2190860499375418948848067

%N a(n) = Sum_{k=1..n} mu(k) * k^n.

%H Seiichi Manyama, <a href="/A344429/b344429.txt">Table of n, a(n) for n = 1..386</a>

%t a[n_] := Sum[MoebiusMu[k] * k^n, {k,1,n}]; Array[a, 20] (* _Amiram Eldar_, May 19 2021 *)

%o (PARI) a(n) = sum(k=1, n, moebius(k)*k^n);

%o (Python)

%o from functools import lru_cache

%o from math import comb

%o from sympy import bernoulli

%o @lru_cache(maxsize=None)

%o def faulhaber(n,p):

%o """ Faulhaber's formula for calculating Sum_{k=1..n} k^p

%o requires sympy version 1.12+ where bernoulli(1) = 1/2

%o """

%o return sum(comb(p+1,k)*bernoulli(k)*n**(p-k+1) for k in range(p+1))//(p+1)

%o @lru_cache(maxsize=None)

%o def A344429(n,m=None):

%o if n <= 1:

%o return 1

%o if m is None:

%o m=n

%o c, j = 1, 2

%o k1 = n//j

%o while k1 > 1:

%o j2 = n//k1 + 1

%o c += (faulhaber(j-1,m)-faulhaber(j2-1,m))*A344429(k1,m)

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

%o return c+faulhaber(j-1,m)-faulhaber(n,m) # _Chai Wah Wu_, Nov 02 2023

%Y Cf. A002321, A008683, A031971, A068340, A321222, A332468, A336276, A336277, A336278, A336279, A344430.

%K sign

%O 1,2

%A _Seiichi Manyama_, May 19 2021

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 19 19:02 EDT 2024. Contains 371798 sequences. (Running on oeis4.)