OFFSET
1,1
COMMENTS
Each row must be either 01 or 10. The two columns are therefore binary complements with sum 2^k-1, where k = n + 1 is the number of rows. If k is even then 2^k-1 is divisible by 3 and the number of solutions is 2*(2^k-1)/3. If k is odd then 2^k-1 == 1 (mod 3) and the number of solutions is (2^k-2)/3. - Andrew Howroyd, Feb 03 2022
LINKS
Paolo Xausa, Table of n, a(n) for n = 1..3000 (terms 1..210 from R. H. Hardin).
Index entries for linear recurrences with constant coefficients, signature (1,4,-4).
FORMULA
a(n) = a(n-1) + 4*a(n-2) - 4*a(n-3).
From Colin Barker, Jan 01 2019: (Start)
G.f.: 2*x / ((1 - x)*(1 - 2*x)*(1 + 2*x)).
a(n) = 2^n - 2/3 - (-2)^n/3. (End)
a(n) = 2*A052992(n-1). - Pascal Bisson, Feb 03 2022
EXAMPLE
All solutions for n=4:
0 1 0 1 1 0 1 0 1 0 0 1 1 0 1 0 0 1 0 1
0 1 0 1 0 1 1 0 0 1 1 0 1 0 0 1 1 0 1 0
1 0 0 1 0 1 1 0 1 0 1 0 0 1 1 0 0 1 0 1
0 1 1 0 0 1 0 1 1 0 1 0 1 0 0 1 1 0 0 1
1 0 0 1 1 0 1 0 1 0 0 1 0 1 0 1 1 0 0 1
MATHEMATICA
LinearRecurrence[{1, 4, -4}, {2, 2, 10}, 40] (* Paolo Xausa, Sep 14 2025 *)
PROG
(Python) [int(2**n - 2/3 -((-2)**n)/3) for n in range(1, 40)] # Pascal Bisson, Feb 03 2022
(PARI) a(n)=2^n-2/3-(-2)^n/3 \\ Charles R Greathouse IV, May 28 2026
CROSSREFS
KEYWORD
nonn,easy,changed
AUTHOR
R. H. Hardin, Oct 08 2015
STATUS
approved
