I wondered, inspired in a result mentioned from [1] (page 45), what should be the asymptotic behaviour of the sequence on assumption of the First Hardy–Littlewood conjecture


$$\sum\_{\substack{\text{primes }p\_n\leq x\\\text{such that }p\_n+2\text{ is prime}}}(p\_{n+1}-p\_n)^2$$


as $x\to\infty$. Thus the summation is over the terms of the sequence *A001359* from the [OEIS](https://oeis.org/A001359), lesser of twin primes 
$$p\_1=3, p\_2= 5,p\_3= 11, p\_4=17,p\_5= 29,\ldots$$


and we assume that the First Hardy–Littlewood conjecture is true.


A reference for the first Hardy–Littlewood conjecture is this section of [Wikipedia.](https://en.wikipedia.org/wiki/Twin_prime#First_Hardy%E2%80%93Littlewood_conjecture)


I don't know if this exercise is in the literature.



> 
> **Question.** Deduce under the assumption that the First Hardy–Littlewood conjecture is true, what should be the asymptotic behaviour of 
>  $$\sum\_{\substack{\text{primes }p\_n\leq x\\\text{such that }p\_n+2\text{ is prime}}}(p\_{n+1}-p\_n)^2$$
>  as $x\to\infty$. If it is in the literature, feel free to refer the reference and I try to search and read the result from the literature. **Many thanks.**
> 
> 
> 


References:
-----------


[1] Richard Crandall and Carl Pomerance, *Prime Numbers: A Computational Perspective*, Second Edition, Springer (2005).



A question about a sum that involves gaps between twin primes, on assumption of the First Hardy–Littlewood conjecture
You want to estimate $x \to +\infty$:
$$\sum\_{\substack{\text{primes }p\_n\leq x\\\text{such that }p\_{n+1}+2\text{ is prime}}}(p\_{n+1}-p\_n)^2$$
Let $n\in 2\mathbb{N}$, and consider the 3 tuple $\mathcal{H}\_3 = (0,n,n+2)$.


The 3-tuple $(0,n,n+2)$ is admissible iff $n = 1 \pmod 3$ or $n = 0 \pmod 3$.


Let $\pi\_{\mathcal{H}\_3}(x) = \#\{(p,p+n,p+n+2) \in \mathbb{P}^3 \, | \, p+n+2 \leq x\}$


The **Hardy-Littlewood** conjecture states that :
$$\pi\_{\mathcal{H}\_3}(x) \sim \left(\displaystyle\prod\_{\text{p prime}}\frac{1-\frac{w(\mathcal{H}\_3, p)}{p}}{(1-\frac1p)^{3}}\right) \, \dfrac{x}{\log(x)^3}$$


Where $w(\mathcal{H}\_3, p)$ is the number of distinct residues $\pmod p$ in $\mathcal{H}\_3$.


We have $w(\mathcal{H}\_3, 2) = 1$ and $w(\mathcal{H}\_3, 3)=2$ and $p \geq 5 \implies w(\mathcal{H}\_3, p)=3$


**Then:**
$$\pi\_{\mathcal{H}\_3}(x) \sim \dfrac{9}{2} \left(\displaystyle\prod\_{\substack{5 \leq p \\ \text{p prime}}}\frac{1-\frac{3}{p}}{(1-\frac1p)^{3}}\right) \, \dfrac{x}{\log(x)^3}$$


See that The **k-tuple conjecture** holds also for consecutive primes.


Then if $\pi\_{\mathcal{H}\_3}(x,n)=\#\{(p\_i,p\_{i+1},p\_{i+2}) \, | \, p\_{i+2}-p\_{i+1}=2, p\_{i+1}-p\_i=n,p\_{i+2}\leq x\}$ we have:


$$\pi\_{\mathcal{H}\_3}(x, n) \sim \dfrac{9}{2} \left(\displaystyle\prod\_{\substack{5 \leq p \\ \text{p prime}}}\frac{1-\frac{3}{p}}{(1-\frac1p)^{3}}\right) \, \dfrac{x}{\log(x)^3}$$




---


We have $n = 0 \bmod 2$ and $\big( n = 0 \bmod 3 \text{ or } n = 1 \bmod 3 \big)$, then:
$$n = 0 \bmod 6 \text{ or } n = 4 \bmod 6 \quad , n \neq 0$$


Suppose that $n \leq N(x)$. 


($N(x)$ is the maximum gap that $p\_{i+2}-p\_{i+1}=2, p\_{i+1}-p\_i=n$ hold in the interval $[1,x]$)


**Then we have:**


$$\displaystyle\sum\_{\substack{\text{primes }p\_k\leq x\\\text{such that }p\_{k+1}+2\text{ is prime}}}(p\_{k+1}-p\_k)^2 = \displaystyle\sum\_{\substack{n \leq N(x) \\ n = 6k, k \in \mathbb{N}^\*}}n^2 \cdot \pi\_{\mathcal{H}\_3}(x, n) + \displaystyle\sum\_{\substack{n \leq N(x) \\ n = 6k+4, k \in \mathbb{N}}}n^2 \cdot \pi\_{\mathcal{H}\_3}(x, n)$$


Using **Granville's conjecture** $N(x) \leq (\alpha+o(1))\log(x)^2$ with $\alpha \geq 2 e^{-\gamma}$.


We have the asymptotic formula for $\pi\_{\mathcal{H}\_3}(x, n)$ not depending of $n$, **Then:**
$$\displaystyle\sum\_{\substack{\text{primes }p\_k\leq x\\\text{such that }p\_{k+1}+2\text{ is prime}}}(p\_{k+1}-p\_k)^2 \sim \pi^{\prime}\_{\mathcal{H}\_3}(x) \left( \displaystyle\sum\_{\substack{n \leq N(x) \\ n = 6k, k \in \mathbb{N}^\*}}n^2 + \displaystyle\sum\_{\substack{n \leq N(x) \\ n = 6k+4, k \in \mathbb{N}}}n^2 \right)$$


With $\pi^{\prime}\_{\mathcal{H}\_3}(x) = \pi\_{\mathcal{H}\_3}(x, 4)$ as example.


