Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #30 Nov 02 2023 17:52:39
%S 1,3,25,239,3091,45863,821227,16711423,387138661,9990174303,
%T 285262663291,8913906888703,302861978789371,11111328334033327,
%U 437889112287422401,18446462446101903615,827238009323454485641,39346257879101283645743,1978418304199236175597105
%N a(n) = Sum_{k=1..n} mu(k) * floor(n/k)^n.
%H Seiichi Manyama, <a href="/A332468/b332468.txt">Table of n, a(n) for n = 1..386</a>
%F a(n) ~ n^n. - _Vaclav Kotesovec_, May 28 2021
%t Table[Sum[MoebiusMu[k] Floor[n/k]^n, {k, 1, n}], {n, 1, 19}]
%t b[n_, k_] := b[n, k] = n^k - Sum[b[Floor[n/j], k], {j, 2, n}]; a[n_] := b[n, n]; Table[a[n], {n, 1, 19}]
%o (PARI) a(n)={sum(k=1, n, moebius(k) * floor(n/k)^n)} \\ _Andrew Howroyd_, Feb 13 2020
%o (Magma) [&+[MoebiusMu(k)*Floor(n/k)^n:k in [1..n]]:n in [1..20]]; // _Marius A. Burtea_, Feb 13 2020
%o (Python)
%o from functools import lru_cache
%o @lru_cache(maxsize=None)
%o def A344527_T(n,k):
%o if n == 0:
%o return 0
%o c, j, k1 = 1, 2, n//2
%o while k1 > 1:
%o j2 = n//k1 + 1
%o c += (j2-j)*A344527_T(k1,k)
%o j, k1 = j2, n//j2
%o return n*(n**(k-1)-1)-c+j
%o def A332468(n): return A344527_T(n,n) # _Chai Wah Wu_, Nov 02 2023
%Y Main diagonal of A344527.
%Y Cf. A008683, A018805, A071778, A082540, A082544, A332469, A343978.
%K nonn
%O 1,2
%A _Ilya Gutkovskiy_, Feb 13 2020