OFFSET
0,2
LINKS
Andrew Howroyd, Table of n, a(n) for n = 0..1000
FORMULA
a(n) = Sum{d|n, d odd} mu(d) * 2^(n/d) for n > 0. - Andrew Howroyd, Sep 14 2019
MATHEMATICA
a[n_] := If[n==0, 1, 2n Total[MoebiusMu[#]*2^(n/#)& /@ Select[Divisors[n], OddQ]]/(2n)];
a /@ Range[0, 31] (* Jean-François Alcover, Sep 23 2019 *)
PROG
(PARI) a(n)={if(n<1, n==0, sumdiv(n, d, if(d%2, moebius(d)*2^(n/d))))} \\ Andrew Howroyd, Sep 14 2019
(Python)
from sympy import mobius, divisors
def A045663(n): return sum(mobius(d)<<n//d for d in divisors(n>>(~n&n-1).bit_length(), generator=True)) if n else 1 # Chai Wah Wu, Jul 22 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved