Skip to main content
3 of 6
deleted 8 characters in body

How many lines of exactly n points can be placed in a discrete, square grid of size m x m?

Per the title, I'm seeking the definition of a function $f(n, m)$ which evaluates to the number of lines made from exactly $n$ points which can be placed on a two-dimensional discrete, square grid of size $m \times m$.

As an aside, I actually only need to know the definition for $n = 3$ where $m$ is odd (not certain that matters), however since I see that $n = 2$ has been answered already, I figured I might as well generalize the question. If it turns out that answering the general form of this question is quite difficult, I will edit to only include $n = 3$.