OFFSET
0,4
REFERENCES
F. Clarke, The Gray code function, in: p-adic methods and their applications, A.J. Baker and R. J. Plymen editors, Oxford University Press, New York 1992, 1-7.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..1000
FORMULA
a(n) = Sum_{k=0..n} (-1)^{n-k} * C(n,k) * g(k), where g is the Gray code function A003188.
MAPLE
g:= proc(n) option remember; `if`(n<2, n,
(b-> b+g(2*b-1-n))(2^ilog2(n)))
end:
a:= n-> add((-1)^(n-k)*binomial(n, k)*g(k), k=0..n):
seq(a(n), n=0..40); # Alois P. Heinz, Oct 09 2008
MATHEMATICA
g[n_] := BitXor[n, Quotient[n, 2]];
a[n_] := Sum[(-1)^(n-k) Binomial[n, k] g[k], {k, 0, n}];
a /@ Range[0, 40] (* Jean-François Alcover, Nov 18 2020 *)
CROSSREFS
KEYWORD
sign
AUTHOR
Jan-Christoph Schlage-Puchta (jcp(AT)math.uni-freiburg.de), Aug 02 2005
EXTENSIONS
More terms from Alois P. Heinz, Oct 09 2008
STATUS
approved