Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
If you look over the edit history I don't believe later versions contradict earlier versions. If they do, I apologize. Regarding the link to my previous question, I'm not sure how this applies? It's similar, but quite distinct.
By "unique" I mean that ordering of the set doesn't matter. e.g. $\{ (0, 0), (0, 1) \}$ should be treated as equivalent to $\{ (0, 1), (0, 0) \}$ -- in retrospect, "distinct" would likely have been a better word choice.
No. For example, for $f(3, 4)$, a line with zero slope which intersects $(0, 0)$ should count twice, as it would apply to the set $\{ (0, 0), (0, 1), (0, 2) \}$ as well as the set $\{ (0, 1), (0, 2), (0, 3) \}$ (assuming grid starts at $(0, 0)$ spanning into the positive quadrant, and each point is spaced 1 unit away from its neighbours).
Thanks, that's perfect. I managed to work backward from your expansion to figure it out well enough to code it up in Python. I was a bit thrown by the bounds of the indexes being defined below the sigma rather than above it.