OFFSET
0,2
PROG
(PARI) T(n, k) = binomial(n, k) - sumdiv(gcd(n+!n, k), d, moebius(d)*binomial(n/d, k/d)); \\ Michel Marcus, Aug 20 2021
row(n) = vector(n+1, k, k--; T(n, k));
a(n) = n*=2; vecsum(row(n)); \\ Michel Marcus, Aug 20 2021
(Python)
from sympy import mobius, divisors
def A050871(n): return -sum(mobius((n<<1)//d)<<d for d in divisors(n<<1, generator=True) if d<n<<1) # Chai Wah Wu, Sep 21 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
a(29) onward corrected by Sean A. Irvine, Aug 20 2021
STATUS
approved