Let's say $x = 161$, and I want to calculate the sum of all : $$\:\frac{x}{5} + \:\frac{x}{11} + \:\frac{x}{17} .... + \:\frac{x}{p} $$ $$(\text{pattern} = \:\frac{x}{\left(6n-1\right)}\:) $$
but the limit $p = floor(\:\frac{\sqrt{x}+1}{6}) = 2, $ since max perfect square bellow $161$ from the list ($5^2, 11^2, 17^2$) is $11^2$
If I'm correct this is the correct formula: $$\sum _{n=1}^{p}\:\frac{x}{\left(6n-1\right)}\:$$ Where $$p=\left\lfloor \frac{\sqrt{x}+1}{6}\right\rfloor$$
Now, how can I calculate it ? ( accurate or approximations) :
I tried the function bellow, and it's very very accurate approximation, but this is for all fractions, $1, 2, 3, 4, 5 ...$, in my example above I want to select only $5, 11, 17, ...$ $$xH(x) \approx x (\ln x+\gamma )-\frac{1}{12 x}+\frac{1}{2}$$ Where $\gamma$ is the Euler-Mascheroni constant $\gamma\approx 0.577215665$.