login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A133226 Number of possible 2 X n arrangements of black and white squares that can form two consecutive rows in an n X n crossword puzzle. 1

%I #2 Feb 27 2009 03:00:00

%S 1,9,36,98,246,646,1777,4883,13120,34642,90976,239160,629427

%N Number of possible 2 X n arrangements of black and white squares that can form two consecutive rows in an n X n crossword puzzle.

%C In a standard American crossword puzzle, such as those in the New York Times, in any row there must be at least one run of white squares and all runs of white squares must be of length at least three.

%F a[n]=2a[n-1]-a[n-2]+a[n-3]+a[n-4]+f[n] where f[n]=b[n]^2-2b[n-1]^2+b[n-2]^2-b[n-3]^2-b[n-4]^2-2b[n-3] and b[n] is the sequence A130578

%e a[4]=9 = 3^2 because using 0's for white squares and 1's for black squares, the three possible rows in a 4 X 4 crossword are 0000, 1000 and 0001 and any of these three rows as a top row is compatible with any as a second row.

%e Furthermore, a[6]=98 < 100 = 10^2 because while 000111 and 111000 are two of the ten possible rows in a 6 X 6 crossword puzzle, the arrangement

%e 000111

%e 111000

%e would not be possible.

%t << DiscreteMath`Combinatorica` (*This program counts, lists and displays the possible 2 - row patterns in an n X n crossword puzzle*)

%t plotnice = ArrayPlot [ #, Frame -> False, Mesh -> True, MeshStyle -> GrayLevel [ 0 ] ] &;

%t For [ n = 3, n <= 7, n++,

%t usablemods = {0, 1, 3, 7};

%t usablenumbers = Function [ MemberQ [ usablemods, Mod [ #, 8 ] ] ];

%t goodnumbers = Union [ Table [

%t k, {k, 0, 2^(n - 3) - 1} ], Table [ k, {k, 2^(n - 1), 2^n - 2} ] ];

%t numbers = Select [ goodnumbers, usablenumbers ];

%t rows = Table [ PadLeft [ IntegerDigits [ numbers [ [ j ] ], 2 ], n ], {j, 1, Length [

%t numbers ]} ];

%t no101s = Function [ FreeQ [ Partition [ #1, 3, 1 ], {1, 0, 1} ] ];

%t no1001s = Function [ FreeQ [ Partition [ #1, 4, 1 ], {1, 0, 0, 1} ] ];

%t legalrows = Select [ Select [ rows, no1001s ], no101s ];

%t tworows = Tuples [ legalrows, 2 ];

%t addrows = Function [ Plus [ # [ [ 1 ] ], # [ [ 2 ] ] ] ];

%t goodrows = Function [ Not [ FreeQ [ Plus [ # [ [ 1 ] ], # [ [ 2 ] ] ], 0 ] ] ];

%t goodtworows = Select [ tworows, goodrows ];

%t Print [ "the number of two-row arrangements in a ", n, " x ", n, " puzzle is \

%t ", Length [ goodtworows ] ];

%t plotnice /@ goodtworows;

%t ]

%Y Cf. A130578.

%K nonn

%O 3,2

%A Marc A. Brodie (mbrodie(AT)wju.edu), Jan 03 2008

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 18 22:18 EDT 2024. Contains 371782 sequences. (Running on oeis4.)