Comment
Comments
Comments in green were written by me. Comments in blue were not written by me.
@Alireza: For 9 there is definitely a neat formula. I would recommend either investigating this with grids of different dimensions and/or thinking about the ways the line passes from one square to another. 21 was not easy - there’s been some discussion already in these comments (including from me)
Blake
on /blog/120
on /blog/120
@Alireza: 9: I didn't try to find a formula, but I made the grid in a spreadsheet, and for each cell, I calculated if the line would pass through that cell.
21: I thought about each group of even A's as a single unit, and thought about how many ways that group of A's could be slotted among the B's. The simplest version of this is the following. You have 2 A's and 9 B's. Treat the 2 A's as a single unit that can't be divided. How many ways can you slot that unit among the B's? Now do that for every possible configuration of even groups of A's. It seems like it'd be a ton of calculation, but it ends up being "only" like 30 cases or something.
21: I thought about each group of even A's as a single unit, and thought about how many ways that group of A's could be slotted among the B's. The simplest version of this is the following. You have 2 A's and 9 B's. Treat the 2 A's as a single unit that can't be divided. How many ways can you slot that unit among the B's? Now do that for every possible configuration of even groups of A's. It seems like it'd be a ton of calculation, but it ends up being "only" like 30 cases or something.
Seth Cohen
on /blog/120
on /blog/120

9: Is there a neat formula for how many squares the line passes through in terms of the dimensions?
21: Should we find a relation between the number of lists of n and the number for n-1 or some other way?
on /blog/120