The generating function enumerating n by 2 0-1 matrices avoiding both vertic\ al and horizontal patterns 010, 101 (i.e. the Mot Alone restrticion) is 3 2 3 t - 6 t - 2 t - 1 - --------------------- 3 2 t - 2 t - 2 t + 1 and in Maple notatin -(3*t^3-6*t^2-2*t-1)/(t^3-2*t^2-2*t+1) For the sake of the OEIS here are the first, 50, terms [4, 16, 36, 100, 256, 676, 1764, 4624, 12100, 31684, 82944, 217156, 568516, 1488400, 3896676, 10201636, 26708224, 69923044, 183060900, 479259664, 1254718084, 3284894596, 8599965696, 22515002500, 58945041796, 154320122896, 404015326884, 1057725857764, 2769162246400, 7249760881444, 18980120397924, 49690600312336, 130091680539076, 340584441304900, 891661643375616, 2334400488821956, 6111539823090244, 16000218980448784, 41889117118256100, 109667132374319524, 287112280004702464, 751669707639787876, 1967896842914661156 , 5152020821104195600, 13488165620397925636, 35312476040089581316, 92449262499870818304, 242035311459522873604, 633656671878697802500, 1658934704176570533904] --------------------------- This took, 0.441, seconds