OFFSET
0,13
COMMENTS
T(h,k) = number of periodic binary words of k 1's and h-k 0's.
EXAMPLE
0;
0,0;
1,0,1;
1,0,0,1;
1,0,2,0,1;
1,0,0,0,0,1;
1,0,3,2,3,0,1;
1,0,0,0,0,0,0,1;
1,0,4,0,6,0,4,0,1;
1,0,0,3,0,0,3,0,0,1;
1,0,5,0,10,2,10,0,5,0,1;
MAPLE
A050186 := proc(n, k)
if n = 0 then
1;
else
add (numtheory[mobius](d)*binomial(n/d, k/d), d =numtheory[divisors](igcd(n, k))) ;
end if;
end proc:
A050870 := proc(n, k)
binomial(n, k)-A050186(n, k) ;
end proc:
seq(seq(A050870(n, k), k=0..n), n=0..20) ; # R. J. Mathar, Sep 24 2011
MATHEMATICA
T[n_, k_] := Binomial[n, k] - If[n == 0, 1, Sum[MoebiusMu[d] Binomial[n/d, k/d], {d, Divisors[GCD[n, k]]}]];
Table[T[n, k], {n, 0, 15}, {k, 0, n}] (* Jean-François Alcover, Jul 01 2019 *)
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
EXTENSIONS
Edited by N. J. A. Sloane, Aug 29 2008
STATUS
approved