# Question concerning twin primes

The multiplication graphs $$p/q$$ – with an edge between $$a,b$$ iff $$ap \equiv b\operatorname{mod} q$$ – for some twin primes $$p$$ and $$q = p+2$$ reveal an astonishing pattern:

• $$(p+0)/(p+1)$$ and $$(p+1)/(p+2)$$ have a seeming $$2$$-fold rotational symmetry.
(This is per se not astonishing.)

• $$(p+0)/(p+2)$$ always has a seeming $$3$$-fold rotational symmetry.
(This is per se astonishing.)

• $$(p-1)/(p+2)$$ and $$(p+0)/(p+3)$$ have a seeming $$4$$-fold rotational symmetry

Note that in each case the symmetry is only a seeming but also an obvious one.

Note further that one might try to generalize this to (for appropriate $$p$$)

• $$(p+n)/(p+m)$$ have a seeming $$|n-m|+1$$-fold rotational symmetry

I wonder: What does this mean?

How do $$2$$, $$3$$, $$4$$ come into play for arbitrary twin primes?

Now I know that the question must be (thanks to Gerhard Paseman):

How do $$2$$, $$3$$, $$4$$ come into play for arbitrary $$6k\pm 1$$ pairs?

The same pattern arises when choosing $$r=6\cdot 41$$ and $$p = r-1$$, $$q = r+1$$:

Note that neither $$p=245$$ nor $$q=247$$ are prime: $$245 = 5\cdot 7^2$$ and $$247 = 13\cdot 19$$.

• Twin primes (with one exception) are 6k+-1. What do your graphs look like for other values of k? Gerhard "Thinks It's About Small Primes" Paseman, 2018.11.19. – Gerhard Paseman Nov 19 '18 at 18:08

To explain what seems to be there you need to describe it more exactly. It might help to draw an edge from $$i$$ to $$j$$ starting a little after $$i$$ because the edges do have a direction.

For the graphs $$n/(n+1)$$ there is an edge from $$i$$ to $$n+1-i$$ (so we could in this case consider them undirected.) This gives a reflective symmetry of order $$2$$ but it can't be a purely rotational symmetry unless $$n+1$$ is even (in which case it is). It is true that the edges are all horizontal (if $$0$$ is at the top) so in the case that $$n+1$$ is odd, overlaying the diagram with itself rotated a half turn puts each rotated edge in a position half way between two parallel former edges of similar length.

So you need to be more specific about what you mean (in your answer below) by $$a+b$$-fold symmetry when the number of points $$an+b$$ is not a multiple of $$a+b.$$

I will look at the graphs $$n/(an+b)$$ in the case that $$a$$ and $$b$$ are relatively prime and $$an+b$$ is a multiple of $$a+b.$$ Then $$n \bmod (a+b) \equiv 1$$ so

$$n/(an+b)={\Big(}p(a+b)+1{\Big)}/{\Big(}(ap+1)(a+b){\Big)}.$$ Here the $$(a+b)$$ fold rotation would take $$i$$ to $$i+ap+1.$$

Note that $$n(ap+1)={\Big(}p(a+b)+1{\Big)}(ap+1) \equiv ap+1 \bmod {\Big(}(ap+1)(a+b){\Big)}$$

So the edge from $$i$$ to $$ni$$ does indeed rotate to an edge from $$i+ap+1$$ to $$ni+n(ap+1) \equiv ni+ap+1.$$

The case that $$\gcd(a,b)=g \gt 1$$ is similar.

LATER

My advice wasn't to draw more graphs, it was to be more specific about the exact nature of the seeming approximate similarity. Ideally expressing it symbolically and using arithmetic/number theory to explain it.

Here is a case that should give sufficient detail to allow a more general analysis. I'll start with diagrams, describe a feature, and then explain it arithmetically. The actual history was in the other direction but it doesn't make as good a story.

I will look at the exact or "almost" $$5$$-fold symmetry For $$n/(2n+3).$$ It is better to do $$n/(n+2)$$ or $$n/(2n+1)$$ first but this case illustrates an additional feature.

Here, first is the case $$16/35$$ which is typical for $$(5q+1)/(10q+5)$$

The small outward segments at $$0,7,14,21,28$$ correspond to the "edges $$(i,i)$$ in those five cases. And we already understand the exact symmetry from a rotation of $$\frac{7}{35}=\frac15.$$

A good illustration of what you see is $$17/37.$$ The middle picture superimposes in red a rotation of $$\frac15$$ which looks approximately symmetric and on the right a rotation of $$2/5$$ which is not so symmetric.

But then there is $$14/31.$$ Here the rotation by $$\frac15$$ is not as close to a symmetry as the rotation by $$2/5.$$

But what does that mean?The complete edge list is

$$[0, 0], [1, 14], [2, 28], [3, 11], [4, 25], [5, 8], [6, 22], [7, 5], [8, 19], [9, 2]$$

$$[10, 16], [11, 30], [12, 13], [13, 27], [14, 10], [15, 24], [16, 7], [17, 21], [18, 4], [19, 18], [20, 1]$$

$$[21,15], [22, 29], [23, 12], [24, 26], [25, 9], [26, 23], [27, 6], [28, 20], [29, 3], [30, 17]$$

There is an angle made by the edges $$[5,8]$$ and $$[8,19]$$ . Moving by $$\frac25$$ of a complete rotation would increase everything by $$\frac{62}5=12.4$$ and move that angle to $$[17.4,20.4]$$ and $$[20.4,31.4]=[20.4,0.4]$$ The closest actual edges are $$[17,21]$$ and $$[20,1].$$ These cross internally though close to the boundary.

This is not an isolated example. One can see that the edges add: $$[6,22]+[7,5]=[13,27].$$ It is easy to see why. There is only one fixed point $$[0,0]$$ and the next closest $$[12,13]$$ and $$[19,18].$$ So an angle $$[i,j],[j,p]$$ rotates to $$[i+12.4,j+12.4],[j+12.4,p+12.4]$$ which is fairly close to actual (crossing) edges $$[i+12,j+13],[j+12,p+13].$$ It could be argued that it is slightly better to advance by $$12.5$$ which is $$\frac{12.5}{31}=0.4032258$$ of a rotation rather that $$\frac25=0.4.$$

So here is my conclusion for the case $$n/m=n/(an+b)$$ which I will limit, for now, to the case that $$\gcd(n,m)=1.$$ Then there is a unique $$0 \lt k \lt m$$ so that the edge $$[k,nk]=[k,k+1] \bmod m.$$ The "best" rotation is by $$\frac{k+0.5}{m}$$ (Rotating that much in the opposite direction is just as good due to the reflective symmetry.) Evidently this is pretty close one of $$\frac{c}{a+b}$$ and $$c$$ depends on the congruence class of $$n \bmod {a+b}.$$ The next step would be to specify how that works and prove it.

In the case $$n/(2n+3):$$

• When $$n=5q+2,$$ such as $$17/37$$ above, one has $$n/(2n+3)=(5q+2)/(10q+7)$$ and for $$k=2q+1,$$we have $$nk=10q^2+9q+2 \equiv 2q+2 \bmod m.$$

• When $$n=5q+4,$$ such as $$14/31$$ above, one has $$n/(2n+3)=(5q+4)/(10q+11)$$ and for $$k=4q+4,$$ $$nk=20q^2+36q+16 \equiv 14q+16 \equiv 4q+5 \bmod m.$$

The other two congruence classes, $$5q$$ and $$5q+3,$$ are similar.

• I followed your advice in a separate answer. – Hans-Peter Stricker Nov 21 '18 at 8:38

The question has an unexpected answer (at least to me). It turns out, that all multiplication graphs of the form $$n/(an + b)$$ have a seeming $$a + b$$-fold rotation symmetry. Especially, graphs of the form $$n/(n + b)$$ have a seeming $$b + 1$$-fold rotation symmetry.

Thus

• all graphs of the form $$n/(n+2)$$ have a seeming $$3$$-fold symmetry

• all graphs of the form $$n/(n+1)$$ have a seeming $$2$$-fold symmetry

• all graphs of the form $$(n-1)/n$$ have a seeming $$2$$-fold symmetry

• all graphs of the form $$(n-1)/(n+2)$$ have a seeming $$4$$-fold symmetry

• all graphs of the form $$n/(n+3)$$ have a seeming $$4$$-fold symmetry

This "explains" the pictures in the question, but has nothing to do with prime numbers and prime twins at all!

What remains to be explained and understood: Why is this so? Why do all multiplication graphs of the form $$n/(an + b)$$ have a seeming $$a + b$$-fold rotation symmetry?

$$a=2$$, $$b=1$$

$$a=2$$, $$b=2$$

$$a=3$$, $$b=1$$

Following Aaron's advice I show here the graphs $$n/(2n+1)$$ and $$n/(n + 2)$$ which have an "approximate" $$3$$-fold rotational symmetry first for small $$n$$, then for large $$n$$, and for $$n=3k + 1$$.

You don't see the approximate symmetry for small $$n$$, except an exact one for the relatively rare cases $$n=3k + 1$$, i.e. for $$4/6$$ and $$7/9$$, resp. for $$4/9$$ and $$7/15$$:

For larger $$n$$ the approximate symmetry becomes obvious while it still holds that only the graphs with $$n=3k + 1$$ are truly symmetric (which for large $$n$$ cannot be checked visually anymore):

Here are the first graphs with $$n = 3k+1$$ which can visually be checked to be truly symmetric: