All twin prime averages in the range $[9, 119]$ are of the form $6(5[3(z-x)]_{\pmod 7} + x)$ for some $x \in \{0,2,3\}, z \in \{0,2,3,4,5\}$.

52 Views Asked by At

Question. Can we come up with a general formula $f(x_5, x_7, x_{11}, \dots, x_{p_n})$ such that each twin prime average $a \in [p_n + 2, p_{n+1}^2 - 2]$ is expressible as $f(x_5, \dots, x_{p_n})$ for some $x_5 \in \{0,2,3\}, \ x_7 \in \{0,2,3,4,5\}, \dots, \ x_{p_n} \in \{0,2,3,4,\dots, p_n - 2\}$. Below I do for the case $n = 4$.

Here is a Desmos graphing calculator link:

https://www.desmos.com/calculator/c8yjoqcuqb

enter image description here

Derivation.

$$ 6(5 y_5 + x_5) \neq \pm 1 \pmod 7 \\ 5y_5 + x_5 = x_7 \pmod 7 \\ \iff y_5 = [\frac{x_7 - x_5}{5}]_7 + 7y_7 \\ $$

So $$ 0 \lt 6(5([\frac{x_7 - x_5}{5}]_7 + 7y_7) + x_5) \lt N \\ \iff 0 \lt (5[\frac{x_7 - x_5}{5}]_7 + 35y_7) + x_5 \lt \frac{N}{6} \\ \iff -x_5 - 5[\frac{x_7 - x_5}{5}]_7 \lt 35y_7 \lt \frac{N}{6} - x_5 -5[\frac{x_7 - x_5}{5}]_7 \\ \frac{-x_5 - 5[\frac{x_7 - x_5}{5}]_7}{35} \lt y_7 \lt \frac{\frac{N}{6} - x_5 - 5[\frac{x_7 - x_5}{5}]_7}{35} \leq \frac{\frac{11^2 -1}{6} - 0 - 0}{35} = \frac{20}{35} $$ Therefore the only possible solution for $y_7$ is $0$.

This means that all twin prime averages in the range $[9, 119]$ are of the form:

$$ 0 \lt f(x_7, x_5) = 6(5[\frac{x_7 - x_5}{5}]_7 + x_5) \lt N =11^2 -1 $$


Worked Case $n = 5$:

$$ 6(5(7y + [3(x_7 - x_5)]_7) + x_5) = x_{11} \\ \iff \\ y = \frac{\frac{\frac{x_{11}}{6} - x_5}{5} - [3(x_7 - x_5)]_7}{7} \pmod{11} \\ \iff \\ y = 11z + \left[\frac{\frac{\frac{x_{11}}{6} - x_5}{5} - [3(x_7 - x_5)]_7}{7}\right]_{11} \\ \\ \ \textbf{So:} \\ f(x_{11}, x_7, x_5) = 6\left(5\left(\left[\frac{x_7 - x_5}{5}\right]_7 + 7\left[\frac{\frac{\frac{x_{11}}{6} - x_5}{5} - [3(x_7 - x_5)]_7}{7}\right]_{11}\right) + x_5\right) $$


Code For Case $n=4$.

def avg_upto_7(x7, x5):
   a = x7 - x5
   a *= 3
   a %= 7
   a *= 5
   a += x5
   a *= 6
   return a

for x7 in range(0, 7):
   if x7 not in {1, 6}:
      for x5 in range(0, 5):
         if x5 not in {1, 4}:
            a = avg_upto_7(x7, x5)
            print(x7, x5, a)
      

Prints:

0 0 0
0 2 42
0 3 168
2 0 180
2 2 12
2 3 138
3 0 60
3 2 102
3 3 18
4 0 150
4 2 192
4 3 108
5 0 30
5 2 72
5 3 198
1

There are 1 best solutions below

1
On BEST ANSWER

Yes, such a formula exists, but that isn't very useful, since we need the twin primes to construct it. Consider the domain $$ S:=\prod_{k=2}^n\{0,2,\ldots,p_k-2\}. $$ Construct an injection $g:S\to\mathbb{Z}$. There are many options. For example, you could define $$g(a_2,\ldots,a_n):=\prod_{k=1}^np_k^{a_k}.$$ Now, enumerate $\operatorname{im}(g)\subset \mathbb{Z}$ by $b_1,\ldots,b_{\#S}$. Say there are $m$ twin prime averages in $[p_{n}+2,p_{n+1}^2-1]$ and enumerate them as $c_1,\ldots,c_m$. Assume $m\le\#S$ and define $h:\mathbb{Z}\to \mathbb{Z}$ by $$ h(x)=\sum_{i=1}^m\left(c_i\cdot\prod_{1\le j\le m,j\neq i}\frac{x-b_j}{b_i-b_j}\right), $$ then $h(b_i)=c_i$ for all $1\le i\le m$, so $f:=h\circ g$ suffices.


Of course, we still need to prove that $m\le \#S$. I leave this to you. Note that $\#S$ grows exponentially in $n$ and $m$ grows about as fast as $n^2\log n$. Now it's just a question of finding some explicit bounds in the literature and messing around with inequalities.