login
A050872
a(n) = (1/2)*A050871 (row sums of array T in A050870, periodic binary words).
2
0, 1, 2, 5, 8, 17, 38, 65, 128, 284, 518, 1025, 2168, 4097, 8198, 16907, 32768, 65537, 133088, 262145, 524408, 1056731, 2097158, 4194305, 8421248, 16777712, 33554438, 67239680, 134217848, 268435457, 537396698, 1073741825, 2147483648
OFFSET
0,3
PROG
(PARI) T(n, k) = binomial(n, k) - sumdiv(gcd(n+!n, k), d, moebius(d)*binomial(n/d, k/d)); \\ A050870
row(n) = vector(n+1, k, k--; T(n, k));
a(n) = n*=2; vecsum(row(n))/2; \\ Michel Marcus, Aug 20 2021
(Python)
from sympy import mobius, divisors
def A050872(n): return -sum(mobius((n<<1)//d)<<d-1 for d in divisors(n<<1, generator=True) if d<n<<1) # Chai Wah Wu, Sep 21 2024
CROSSREFS
Sequence in context: A181586 A112361 A343129 * A086324 A293830 A073708
KEYWORD
nonn
EXTENSIONS
a(29) onward corrected by Sean A. Irvine, Aug 20 2021
STATUS
approved