login
Number of n X 2 0..1 arrays with row sums equal and column sums unequal to adjacent columns.
6

%I #36 Sep 08 2022 08:46:01

%S 2,2,8,10,32,44,128,186,512,772,2048,3172,8192,12952,32768,52666,

%T 131072,213524,524288,863820,2097152,3488872,8388608,14073060,

%U 33554432,56708264,134217728,228318856,536870912,918624304,2147483648,3693886906

%N Number of n X 2 0..1 arrays with row sums equal and column sums unequal to adjacent columns.

%C Column 2 of A202742.

%C a(n) is the number of binary words of length n such that the number of 0's is not equal to the number of 1's. - _Geoffrey Critzer_, Dec 05 2013

%C Also the degree of the irreducible polynomial that defines the multifocal ellipsoid with n foci, see links. - _Moritz Firsching_, Aug 31 2015

%H R. H. Hardin, <a href="/A202736/b202736.txt">Table of n, a(n) for n = 1..210</a>

%H Jiawang Nie, Pablo A. Parrilo, Bernd Sturmfels, <a href="http://arxiv.org/abs/math/0702005">Semidefinite Representation of the k-Ellipse</a>, arXiv:math/0702005 [math.AG], 2007.

%F For odd n, a(n) = 2^n, for even n, a(n) = 2^n - binomial(n,n/2). - _Geoffrey Critzer_, Dec 05 2013

%F a(n) = 2^n*(1-(((-1)^n+1)*Gamma((n+1)/2))/(2*sqrt(Pi)*Gamma((n+2)/2))). - _Peter Luschny_, Sep 10 2014

%F a(n) = 2^n - A126869(n). - _Peter Luschny_, Sep 10 2014

%F From _Robert Israel_, Aug 31 2015: (Start)

%F G.f.: 1/(1-2*x) - 1/sqrt(1-4*x^2).

%F E.g.f.: exp(2*x) - I_0(2*x) where I_0 is a modified Bessel function.

%F a(n) = ((-8*n+16)*a(n-3)+(4*n-4)*a(n-2)+(2*n-2)*a(n-1))/n. (End)

%e Some solutions for n=5

%e ..0..1....0..1....0..1....0..1....0..1....1..0....0..1....1..0....0..1....0..1

%e ..0..1....0..1....0..1....1..0....1..0....1..0....0..1....1..0....0..1....1..0

%e ..1..0....1..0....0..1....1..0....0..1....0..1....1..0....1..0....0..1....0..1

%e ..0..1....1..0....1..0....1..0....0..1....1..0....0..1....1..0....0..1....1..0

%e ..0..1....1..0....1..0....1..0....0..1....1..0....1..0....1..0....1..0....1..0

%p seq(2^n - `if`(n::even, binomial(n,n/2), 0), n = 1 .. 30); # _Robert Israel_, Aug 31 2015

%t f[n_]:= If[EvenQ[n],2^n-Binomial[n,n/2],2^n];Drop[Table[f[n],{n,0,32}],1] (* _Geoffrey Critzer_, Dec 05 2013 *).

%o (Sage)

%o A202736 = lambda n: 2^n*(1-(((-1)^n+1)*gamma((n+1)/2))/(2*sqrt(pi)*gamma((n+2)/2)))

%o [A202736(n) for n in (1..32)] # _Peter Luschny_, Sep 10 2014

%o (Magma) I:=[2,2,8]; [n le 3 select I[n] else ((-8*n+16)*Self(n-3)+(4*n-4)*Self(n-2)+(2*n-2)*Self(n-1))/n: n in [1..40]]; // _Vincenzo Librandi_, Sep 01 2015

%Y Cf. A126869.

%K nonn

%O 1,1

%A _R. H. Hardin_, Dec 23 2011