OFFSET
1,3
FORMULA
a(n) = sum_{k = 1+floor(n/2)...n} binomial(2n,n-k), sum of the n/2 rightmost elements of row n of A094527. - Giovanni Resta, May 31 2013
EXAMPLE
With n=3 there are 7 vectors with sum bigger than 3:
{1, 1, 1, 1, 1, 1}
{-1, 1, 1, 1, 1, 1}
{1, -1, 1, 1, 1, 1}
{1, 1, -1, 1, 1, 1}
{1, 1, 1, -1, 1, 1}
{1, 1, 1, 1, -1, 1}
{1, 1, 1, 1, 1, -1}
So a(3) = 7.
MAPLE
MATHEMATICA
a[n_] := Sum[(2*n)!/((n-k)!*(n+k)!), {k, 1 + Floor[n/2], n}]; Array[a, 30] (* Giovanni Resta, May 31 2013 *)
PROG
(C)
#include <stdio.h>
long long count, n;
void addOne(long long sum, long long added) {
if (added==n*2) {
if (sum>n) ++count;
return;
}
++added;
addOne(sum+1, added);
addOne(sum-1, added);
}
int main() {
for (n=1; n<99; n++) {
count = 0;
addOne(0, 0);
printf("%llu, ", count);
}
return 0;
}
CROSSREFS
KEYWORD
nonn
AUTHOR
Alex Ratushnyak, May 31 2013
STATUS
approved