Number of distinct normalized vectors from the center of a hexagon in a hexagonal grid

Consider an infinite hexagonal grid composed of regular hexagons. Choose any hex to be the origin hex. Let n be a natural number.

Find an expression, in terms of n, for the number of distinct normalized vectors from the center of the origin hex to the center of every hexagon whose distance from the origin (measured in hexagons) is less than or equal to n.

I manually calculated up to n=15:

n distinct normalized vectors increment
1 6 -
2 12 6
3 24 12
4 36 12
5 60 24
6 72 12
7 108 36
8 132 24
9 168 36
10 192 24
11 252 60
12 276 24
13 348 72
14 384 36
15 432 48

What I do know:

1. The increment from n to n+1 has to be a multiple of 6, because of the simmetry of the hexagon.
2. The expression has to be less than 3n^2+3n, since this is the formula for the total number of hexagons at a distance n, at most, from the origin hex (in hexagons);
3. When n is prime, the increment from n-1 is 6*(n-1).
• The deltas look to be $f(n)=6\phi(n)$ with a possible correction term at odd multiples of 3; the formula agrees for all $n$ you've shown except for $n=9,15$ where it's off by 1. Commented Sep 13, 2021 at 15:18
• @Steven Stadnicki. This makes sense, as a deformation of the lattice should make this problem equivalent to the analogous one with squares. Then it's essentially like counting primitive (GCD=1) pairs of numbers, up to each $n$. Commented Sep 13, 2021 at 15:51
• That was pretty much my thinking as well — I imagine some careful digging would turn up the origin of the correction term too; I just haven't looked closely yet. Commented Sep 13, 2021 at 16:31
• @Pruthviraj I am sorry, I am new to this, I didn't know posting on both Stackexchange and Overflow was abusing the system. I am not sure where this problem belongs though. I guess since there are more comments here already than there, I should delete the one from Stackexchange? Commented Sep 13, 2021 at 17:34
• @StevenStadnicki Thanks guys for the early insights! I see now the increments follow almost exactly 6*Phi(n), except at odd multiples of 3. I would appreciate so much if this could be proved and the source of the discrepancy at odd multiples of 3. This problem arose in an actual project I am working on, where I need to know the results for n up to 50. Commented Sep 13, 2021 at 17:40

Let's move the centers of the hexagons to the grid $$\mathbb{Z}\times\mathbb{Z}$$ by an affine transformation, so that the centers of the hexagons at hexagonal distance less than or equal to $$n$$ are now represented by the more Cartesian-looking (but uglier) set $$H_n:=\{(x,y)\in\mathbb{Z}\times\mathbb{Z}: |x|\le n, |y|\le n, |x-y|\le n, \}.$$ We can partition $$H_n$$ into the area in the axis, a square on the first quadrant and a square on the third quadrant; a triangle in the second and a triangle in the fourth quadrant. Counting separately the corresponding normalized vectors from each set, we get, for your $$H(n)$$ for $$n\ge1$$ $$H(n)=4+2A(n)+2B(n)$$, where $$A(n):=\{(x,y)\in\mathbb N_+ \times \mathbb N_+ : x\le n, y\le n, (x,y)=1\}$$ is easily seen to be $$A(n)= -1+\sum_{k=1}^n \phi(k)=$$ A18805 , and so is $$B(n):=\{(x,y)\in\mathbb N_+ \times \mathbb N_+ : 1\le x which is $$B(n)=2\sum_{k=1}^n \phi(k)=$$ A15614. So for $$n\le50$$ you have
$$6,12,24,36,60,72,108,132,168,192,$$$$252,276,348,384,432,480,576,612,720, 768,$$$$840,900,1032,1080,1200,1272,1380,1452,1620,1668,$$$$1848,1944,2064, 2160,2304,2376,2592,2700,2844,2940,$$$$3180,3252,3504,3624,3768,3900,4176, 4272,4524,4644,4836,4980,5292,$$$$\dots$$
(In particular the first difference is $$6\phi(n)$$ as was immediately spotted by Steven Stadnicki)
• (Shouldn't $(0,0)$ be counted too, as the 0-distance point from the origin?) Commented Sep 14, 2021 at 20:01