I came across the very elementary sequence https://oeis.org/A001047 in my research. The sequence is $a_n=3^n-2^n$. Thus $a_1=1$, $a_2=5$, $a_3=19$ and so on. In the comments section it reads 'Number of distinct lines through the origin in the n-dimensional lattice of side length 2.' I find this very confusing, because if the author refers to the number of distinct line segments of length two where both endpoints are points in the integer lattice $\mathbb{Z}^n$ then sequence would be just $a_n=n$, since the only possible endpoints would be given by the standard unit bases. Does someone know what exactly the author means here?
There
The lattice has side length $2$, not the lines. I think they are talking about the set $\{0,1,2\}^n$ and a line through the origin is a line in $\mathbb{R}^n$ that goes through the origin and at least one other lattice point. There is exactly one such line for every point in $\{0,1,2\}^n$ which has at least one coordinate equal to $2$. Thus there are $3^n - 2^n$ such lines.