Friday, September 22, 2017

Proof for the Expected Value Problem III


Let $ABC$ be a triangle with $AB=c$, $BC=a$, and $CA=b$. Let $D$, $E$ and $F$ denote the feet of the altitudes from $A$, $B$ and $C$ receptively such that $AD=h_a$, $BE=h_b$ and $CF=h_c$.

First off, we define some notations. Let $L$ be the length of the line drawn by selecting a random point $P$ in a triangle $ABC$ and let $X$ be the point where the random line intersects the triangle.

Let $\mathbb{E}_{\triangle ABC}(L|S_k)$ be the expected length of the line drawn as described in setup $S_k$ in the triangle $ABC$.

Setup 1 Select a random point in triangle $ABC$ and draw a line (towards $BC$) parallel to the altitude $AD$.

WLOG, we can chose the vertex $B$ to be the origin with the $x$-axis aligned with the side $BC$. Then we have,

$\displaystyle\mathbb{E}_{\triangle ABC}(L|S_1)=\frac{1}{\triangle ABC}\iint\limits_{(x,y)\in\triangle ABC}|PX|\,dy\,dx=\frac{1}{\triangle ABC}\iint\limits_{(x,y)\in\triangle ABC}y\,dy\,dx=\frac{h_a}{3}$

The last equality follows by recognizing the integral as the $y$-coordinate of the centroid of the triangle $ABC$.

Setup 2 Given a point $M$ between $B$ and $D$, select a random point in triangle $ABC$ and draw a line (towards $BC$) parallel to $AM$ until it meets the triangle. Let $t$ be the angle between $AM$ and $AD$ (measured clockwise from $AD$).

Using the same co-ordinate system as above, this time we have,

$
\begin{align}
\displaystyle\mathbb{E}_{\triangle ABC}(L|S_2,M)&=\frac{1}{\triangle ABC}\iint\limits_{(x,y)\in\triangle ABC}|PX|\,dy\,dx\\
&=\frac{1}{\triangle ABC}\iint\limits_{(x,y)\in\triangle ABC}\frac{y}{\cos t}\,dy\,dx=\frac{h_a}{3\cos t}=\frac{|AM|}{3}
\end{align}
$

Setup 3 Given a point $M$ between $B$ and $D$, select a random point in triangle $ABC$ and draw a line (away from $BC$) parallel to $AM$ until it meets the triangle. Let $t$ be the angle between $AM$ and $AD$ (measured clockwise from $AD$).

Now we do a case distinction based on whether the random point is in $\triangle ABM$ or $\triangle AMC$.

$
\begin{align}
\displaystyle\mathbb{E}_{\triangle ABC}(L|S_3,M)&=\frac{\triangle MAB}{\triangle ABC}\mathbb{E}_{\triangle MAB}(L|S_2,A)+\frac{\triangle MCA}{\triangle ABC}\mathbb{E}_{\triangle MCA}(L|S_2,A)\\
&=\frac{\triangle ABM}{\triangle ABC}\frac{|MA|}{3}+\frac{\triangle AMC}{\triangle ABC}\frac{|MA|}{3}\\
&=\frac{|AM|}{3}\\
\end{align}
$

Surprisingly, it doesn't matter whether we draw the line towards or away from the edge $BC$, the expected value remains the same.

Setup 4 Given a point $M$ between $B$ and $D$, select a random point in triangle $ABC$ and draw a line (either towards or away from $BC$) parallel to $AM$ until it meets the triangle. Let $t$ be the angle between $AM$ and $AD$ (measured clockwise from $AD$).

From the previous discussion, we have,

$\displaystyle\mathbb{E}_{\triangle ABC}(L|S_4,M)=\frac{|AM|}{3}$

This can be equivalently written as,

$\displaystyle\mathbb{E}_{\triangle ABC}(L|S_4,t)=\frac{h_a}{3\cos t}$


Setup 5 Select a random point in triangle $ABC$ and draw a line (either towards or away from $BC$) until it meets the triangle, such that the angle $t$ between $PX$ and $AD$ (measured clockwise from $PX$) satisfies $0 \leq t \leq \tan^{-1}\left(\frac{BD}{AD}\right)$.

Using the law of the total probability,

$
\begin{align}
\mathbb{E}_{\triangle ABC}(L|S_5)&=\mathbb{E}(\mathbb{E}_{\triangle ABC}(L|S_4,t))\\
&=\frac{1}{\tan^{-1}\left(\frac{BD}{AD}\right)}\int\limits_0^{\tan^{-1}\left(\frac{BD}{AD}\right)}\frac{h_a}{3\cos t}\,dt\\
\end{align}
$

We can use the fact that $\int\limits_0^{\tan^{-1}m}\sec t\,dt=\text{sinh}^{-1}m$, we have

$\displaystyle\mathbb{E}_{\triangle ABC}(L|S_5)=\frac{h_a}{3\tan^{-1}\left(\frac{BD}{AD}\right)}\text{sinh}^{-1}\left(\frac{BD}{AD}\right)$


Setup 6 Select a random point in triangle $ABC$ and draw a line (either towards or away from $BC$) until it meets the triangle, such that the angle $t$ between $PX$ and the side $AB$ (measured clockwise from $PX$) satisfies $0 \leq t \leq \angle A$.

We again make a case distinction based on where the ray $PX$ intersects the side $BC$ - either in $BD$ or in $DC$. We can separate the angle into two cases based on this. Using the previous result, we have,

$\displaystyle\mathbb{E}_{\triangle ABC}(L|S_6)=\frac{h_a}{3\angle A}\left(\text{sinh}^{-1}\left(\frac{BD}{AD}\right)+\text{sinh}^{-1}\left(\frac{DC}{AD}\right)\right)$

This, after some basic simplifications, results in,

$\displaystyle\mathbb{E}_{\triangle ABC}(L|S_6)=\frac{h_a}{3\angle A}\text{csch}^{-1}\left(\frac{p}{a}\frac{s-a}{p-a}\right)$

where $p$ and $s$ are the perimeter and semi-perimeter of $\triangle ABC$ respectively.

Now we get into the final part of the proof.

Setup 7 Select a random point in triangle $ABC$ and draw a line at a random angle from that point until it meets the triangle.

We now again do a case distinction based on the angle and using the previous result, we finally have,

$
\begin{align}
\displaystyle\mathbb{E}_{\triangle ABC}(L)&=\sum_{x \in \{a,b,c\}}\frac{h_x}{3\pi}\text{csch}^{-1}\left(\frac{p}{x}\frac{s-x}{p-x}\right)\\
&=\frac{h_a}{3\pi}\text{csch}^{-1}\left(\frac{p}{a}\frac{s-a}{p-a}\right)+\frac{h_b}{3\pi}\text{csch}^{-1}\left(\frac{p}{b}\frac{s-b}{p-b}\right)+\frac{h_c}{3\pi}\text{csch}^{-1}\left(\frac{p}{c}\frac{s-c}{p-c}\right)
\end{align}
$

And hence the result. Hope you enjoyed this. I'll come up with something different the next time.

UPDATE (13 / 8 / 2020): Updating the 'boring calculation' used in Setup 6.

By the addition formulae for Inverse Hyperbolic sines,

$\displaystyle \text{sinh}^{-1}\left(\frac{BD}{AD}\right)+\text{sinh}^{-1}\left(\frac{CD}{AD}\right)=\text{sinh}^{-1}\left(\frac{CD}{AD}\frac{AB}{AD}+\frac{BD}{AD}\frac{AC}{AD}\right)$

Using the geometry of the triangle we know that,

$BD=c \cos B$, $CD=b \cos C$ and $AD=b \sin C=c \sin B$

$\displaystyle \text{sinh}^{-1}\left(\frac{BD}{AD}\right)+\text{sinh}^{-1}\left(\frac{CD}{AD}\right)=\text{sinh}^{-1}\left(\frac{\cos B+\cos C}{\sin B \sin C}\right)$

But
$\sin B \sin C=2\sin(B/2)\cos(B/2)\cdot 2\sin(C/2)\cos(C/2)=2\sin(B/2)\sin(C/2)\cdot 2\cos(B/2)\cos(C/2)$

With Sine and Cosine addition formula, this becomes,

$\sin B \sin C=(\cos(B/2+C/2)-\cos(B/2-C/2))(\cos(B/2+C/2)+\cos(B/2-C/2))=\cos^2(B/2+C/2)-\cos^2(B/2-C/2)$

Also, $\displaystyle \cos B+\cos C=2\cos(B/2+C/2)\cos(B/2-C/2)$

Therefore,

$\displaystyle \frac{\sin B \sin C}{\cos B+\cos C}=\frac{1}{2}\left(  \frac{\cos(B/2+C/2)}{\cos(B/2-C/2)}-\frac{\cos(B/2-C/2)}{\cos(B/2+C/2)}  \right)$

The rest follows by Mollweide's formula.

Until then,
Yours Aye
Me

Thursday, September 21, 2017

An Expected Value Problem III


In An Expected Value Problem, we found the expected length of a line segment drawn by picking a random point in a rectangle and choosing a random angle, and extending it until it meets the edge of a rectangle. We ask the same question here for an arbitrary acute angled triangle in this post.

Let $ABC$ be a triangle with $AB=c$, $BC=a$, and $CA=b$. Let $D$, $E$ and $F$ denote the feet of the altitudes from $A$, $B$ and $C$ receptively such that $AD=h_a$, $BE=h_b$ and $CF=h_c$. I considered this question in the same post above, but I was not able to solve it then.

But recently I collaborated with someone who gave me a very valuable hint which reduced the difficulty of the problem drastically. The idea pretty much solved the problem. In summary, if we denote the length of line segment as $L$, we have,

$
\begin{align}
\displaystyle\mathbb{E}(L)&=\sum_{x \in \{a,b,c\}}\frac{h_x}{3\pi}\text{csch}^{-1}\left(\frac{p}{x}\frac{s-x}{p-x}\right)\\
&=\frac{h_a}{3\pi}\text{csch}^{-1}\left(\frac{p}{a}\frac{s-a}{p-a}\right)+\frac{h_b}{3\pi}\text{csch}^{-1}\left(\frac{p}{b}\frac{s-b}{p-b}\right)+\frac{h_c}{3\pi}\text{csch}^{-1}\left(\frac{p}{c}\frac{s-c}{p-c}\right)
\end{align}
$

where $p$ and $s$ denote the perimeter and the semi-perimeter respectively.

Let's calculate the expected values for a few special cases.

$\mathbb{E}(1,1,1)\approx 0.30284835$ and $\mathbb{E}(3,4,5)\approx 1.100147755$

The interest in this question seems very low in the mathematical literature and I was not able to find any material in the internet to verify these values. However, a friend of mine wrote a simulation for the Pythagorean case and the result matched with the value given by the formulae.

Two things are to be mentioned here. First, even though we dealt with the same question for a triangle and a rectangle, note that the formulas are drastically different. Some may find it obvious that they are different but I had an intuition that they'll be pretty 'close' which turned out to be wrong.

Second, the individual terms in the above formulae can themselves are respective expected values for a different question. I'll follow up with the what those questions are and the proof of this formulae in the next few posts.


Until then,
Yours Aye
Me

Saturday, June 10, 2017

An Expected Value problem II

We saw the explicit expression for the expected distance from a random point inside a rectangle to an edge of the rectangle in the previous post. We deal with a similar problem here.

There are a lot of reference in the internet to find the expected distance between two random points in a rectangle (Stack Exchange post). Here we ask 'what is the expected distance between two random points in a right angled triangle?'.

Basically the question is conceptually simple and the expression for the expected value can be readily written as follows:

$\mathbb{E}_T(L)=\displaystyle\int\limits_0^a \int\limits_0^{mx}\int\limits_0^a\int\limits_0^{mu}\sqrt{(x-u)^2+(y-v)^2}\,dv\,du\,dy\,dx$

where the right angled triangle is formed by the points $(0, 0)$, $(a, 0)$, and $(a, b)$. Also, for simplicity we used $m=b/a$.

Now, the difficulty of this integral (and the one that makes it different from the rectangle case) is the variable limits of the integral. In case of a rectangle, all the limits would be constants which makes it a little easier.

I'm not going to go through all the details and trouble I went through to solve this. But it is a combination of both Mathematica and a lot of paper work. Finally, after a few days and hell-a-lot completely messed up ideas later, I ended up with the following explicit expression for the expected value.

$\mathbb{E}_T(L)=\displaystyle\frac{a^3+b^3+2 d^3}{15 d^2}+\frac{a^2 }{15 b}\left(\frac{b^3}{d^3}+1\right)\text{csch}^{-1}\left(\frac{a}{b}\right)+ \frac{b^2}{15 a}\left(\frac{a^3}{d^3}+1\right) \text{csch}^{-1}\left(\frac{b}{a}\right)$

where $d=\sqrt{a^2+b^2}$.

I also wrote a small python program in an Online IDE to verify the correctness of this result.

For example, for $a=2$ and $b=3$, the formula gives

$\mathbb{E}_T(L)=\displaystyle\frac{1}{195} \left(35+26 \sqrt{13}\right)+\frac{4}{45} \left(1+\frac{27}{13 \sqrt{13}}\right) \text{csch}^{-1}\left(\frac{2}{3}\right)+\frac{3}{10} \left(1+\frac{8}{13\sqrt{13}}\right) \text{csch}^{-1}\left(\frac{3}{2}\right) \approx 1.047156999$

whereas the simulation gives $1.047117963$ after $10^8$ trials (takes about 200 secs).

Now for completion sake we also give the expected length of two random points in a rectangle. Here we have,

$\mathbb{E}_R(L)=\displaystyle\frac{a^5+b^5-\left(a^4-3 a^2 b^2+b^4\right)d}{15 a^2 b^2}+\frac{a^2}{6 b}\text{csch}^{-1}\left(\frac{a}{b}\right)+\frac{b^2 }{6 a}\text{csch}^{-1}\left(\frac{b}{a}\right)$

One of the nice things of putting these two together is, now we can also get an expression for the length of two random points lying on opposite sides of diagonal $AC$ of rectangle $ABCD$. Denoting this expected length by $\mathbb{E}_D(L)$ (D denoting diagonal), we have this relation from which we can find the required value.

$\mathbb{E}_R(L)=\displaystyle\frac{1}{4}\mathbb{E}_T(L)+\frac{1}{4}\mathbb{E}_T(L)+\frac{1}{2}\mathbb{E}_D(L)$

I tried to get an expression but it doesn't factor nicely but so it better left out. Hope you enjoyed this.


Until then
Yours aye
Me

Wednesday, June 7, 2017

An Expected Value Problem

Hi All... Recently I thought of a problem and tried to solve it. To my surprise, I ended up with a closed form solution for the same which I would like to share with you by this post.

Consider a rectangle $ABCD$ with the longest side $AB=CD=a$ units and shorter side $BC=DC=b$ units. Now pick a random point in this rectangle and a draw a straight line from this point at a random angle until the line meets the edge of the rectangle. What will be the expected value of this line?

We can attack the problem head-on with multiple integrals. Let $L$ be the length of the line. Then we have,

$\mathbb{E}(L)=\displaystyle\frac{1}{ab}\frac{1}{2\pi}\int\limits_{0}^{a}\int\limits_{0}^{b}\int\frac{y}{\sin t}\,dt\,dy\,dx$

The limits of the innermost integral have been left out purposely. We have to decompose the innermost integral. Let's do it this way. Consider the point $(x,y)$. We'll call it $P$.

Now draw a perpendicular from this point to each of the four sides of the rectangle. Let the perpendicular meet the side $X$ at $P_X$. Also join this point to each of the four vertices of the rectangle. This splits the entire rectangle into eight regions. 

Consider the integral $I(a,b)$ (ignoring constant factors for time being) for the 'random lines' that end up in region $PAP_{AB}$

$I(a, b)=\displaystyle\int\limits_{0}^{a}\int\limits_{0}^{b}\int\limits_{\tan^{-1}(y/x)}^{\pi/2}\frac{y}{\sin t}\,dt\,dy\,dx$

But reflecting the 'random lines' about the $y$-axis, this integral also represents the $PP_{AB}B$, reflecting about the $x$-axis, this integral represents region $PP_{CD}D$, reflecting w.r.t both the axes it represents region $PCP_{CD}$. Solving this one integral covers four of the eight regions.

This is integral is pretty simple to solve with standard tables (or atmost with Mathematica). We get,

$I(a,b)=\displaystyle\frac{1}{6}\left(2b^3-a^3+d^3-3b^2d+3ab^2\ln{\frac{a+d}{b}}\right)$

where $d$ is the length of the diagonal of the rectangle.

Now for the other regions. We don't have to solve anything separately. Just interchange the values of $a$ and $b$. This amounts to rotating the rectangle by $90$ degrees and reasoning as before for the four other regions.

Note the nice thing that in going over the eight regions, we have made the full $2\pi$ radians possible for the 'random line'. So finally we have,

$\mathbb{E}(L)=\displaystyle\frac{4I(a,b)+4I(b,a)}{2\pi ab}$

Simplifying things we finally we end up with,

$\mathbb{E}(L)=\displaystyle\frac{a^3+b^3-d^3}{3\pi ab}+\frac{a}{\pi}\ln{\frac{b+d}{a}} + \frac{b}{\pi}\ln{\frac{a+d}{b}}$

(or)

$\mathbb{E}(L)=\displaystyle\frac{a^3+b^3-d^3}{3\pi ab} +\frac{a}{\pi}\text{csch}^{-1}\left(\frac{a}{b}\right)+ \frac{b}{\pi}\text{csch}^{-1}\left(\frac{b}{a}\right)$


The rectangle had a lot of symmetry that we were able to exploit. I'm trying to do the same for a given arbitrary triangle but it seems so very difficult with complicated integrals cropping at all places. I'll update if end up with something.


Until then,
Yours aye
Me

Saturday, May 13, 2017

Division of Dirichlet Series with Python


We saw how to do Dirichlet Series multiplication in the previous post. This post is about dividing two Dirichlet series. Using pretty much the same notation as before, here we are concerned about the following.

$H(s)=\displaystyle\frac{F(s)}{G(s)}$

We can use the following Python code to get the Summatory function $H(n)$.

Note: We know that Dirichlet inverse exists if and only if $g(1)\ne0$. In fact, for most of the multiplicative functions $g(1)=1$. So I have made this assumption in the code. If it is not, changes have to made accordingly.

from timeit import default_timer

start = default_timer()

n = 1000000000
s = int(n ** 0.5)

Divs = [0] * (1 + s)

for k in range(1, 1 + s):
    temp = [1] if k == 1 else [1, k]
    stemp = int(k ** 0.5)
    for j in range(2, 1 + stemp):
        if k % j == 0:
            if j * j == k:
                temp += [j]
            else:
                temp += [j, k // j]
    Divs[k] = sorted(temp)


def DirDiv(Lowsn, Highsn, Lowsd, Highsd, n):
    s = int(n ** 0.5)
    Lows, Highs = [0] * (1 + s), [0] * (1 + s)
    Lows[1] = 1 // (Lowsd[1] - Lowsd[0])
    for k in range(2, 1 + s):
        for j in Divs[k][:-1]:
            Lows[k] -= (Lows[j] - Lows[j - 1]) * (Lowsd[k // j] - Lowsd[k // j - 1])
        Lows[k] += Lowsn[k] - Lowsn[k - 1]
        Lows[k] *= Lows[1]
        Lows[k] += Lows[k - 1]
    for k in range(s, 0, -1):
        tempn = n // k
        res = Highsn[k]
        u = int(tempn ** 0.5)
        v = tempn // (1 + u)
        for i in range(1, 1 + v):
            res -= (Lows[i] - Lows[i - 1]) * (Highsd[k * i] if k * i <= s else Lowsd[tempn // i])
        for i in range(2, 1 + u):
            res -= (Lowsd[i] - Lowsd[i - 1]) * (Highs[k * i] if k * i <= s else Lows[tempn // i])
        i = 1 + u
        res += Lows[tempn // i] * Lowsd[u]
        Highs[k] = res
    return Lows, Highs


Lowsn, Highsn = [0] + [1] * s, [0] + [1] * s
Lowsd, Highsd = [k for k in range(1 + s)], [0] + [n // k for k in range(1, 1 + s)]
Lows, Highs = DirDiv(Lowsn, Highsn, Lowsd, Highsd, n)
print(Highs[1])
print(default_timer() - start)

As in the multiplication case, here again the 'Lows' and 'Highs' mean the same. In the sample code given above, we have $F(s)=1$ and $G(s)=\zeta(s)$. This means $H(s)$ is the Dirichlet series of the Moebius function.

As a result, we get the values of the Merten's function as the output. Here again, the runtime of the algorithm is about $O(n^{\frac{3}{4}})$.

Until then
Yours Aye
Me

Multiplication of Dirichlet Series with Python


It is well known that polynomial multiplication can be much more efficiently using Fast Fourier Transform. I was searching for similar to use in case Dirichlet series. For example, if I have two functions $f(n)$ and $g(n)$, with Dirichlet series $F(s)$ and $G(s)$ respectively, what would be efficient way to get the summartory function of the Dirichlet convolution of the two functions?

Again, we could simply use the Dirichlet's Hyperbola method to get a very generic algorithm to solve this.

Let $f(n)$ and $g(n)$ be two arithmetic functions. Define $h(n)=(f*g)(n)$ as the Dirichlet convolution of $f$ and $g$. Also, let $F(n)$, $G(n)$ and $H(n)$ be the summatory functions for the respective functions.

Now using the formulas we saw in Dirichlet's Hyperbola method, I wrote the following Python code that does the job. The runtime of the following algorithm is about $O(n^{\frac{3}{4}})$

from timeit import default_timer

start = default_timer()

Lim = 1000000000
s = int(Lim ** 0.5)

Divs = [0] * (1 + s)

for k in range(1, 1 + s):
    temp = [1] if k == 1 else [1, k]
    stemp = int(k ** 0.5)
    for j in range(2, 1 + stemp):
        if k % j == 0:
            if j * j == k:
                temp += [j]
            else:
                temp += [j, k // j]
    Divs[k] = sorted(temp)


def DirMult(Losf, Highsf, Losg, Highsg, n):
    s = int(n ** 0.5)
    Highs = [0]
    Los = [0] * (1 + s)
    for k in range(1, 1 + s):
        temp = 0
        for j in Divs[k]:
            temp += (Losf[j] - Losf[j - 1]) * (Losg[k // j] - Losg[k // j - 1])
        Los[k] = Los[k - 1] + temp
        temp, tempn = 0, Lim // k
        u = int(tempn ** 0.5)
        v = tempn // (1 + u)
        mini, maxi = min(u, v), max(u, v)
        for j in range(1, 1 + mini):
            temp += (Losf[j] - Losf[j - 1]) * (Highsg[k * j] if k * j <= s else Losg[tempn // j]) + (Losg[j] - Losg[
                j - 1]) * (Highsf[k * j] if k * j <= s else Losf[tempn // j])
        for j in range(1 + mini, 1 + maxi):
            temp += (Losg[j] - Losg[j - 1]) * (Highsf[k * j] if k * j <= s else Losf[tempn // j])
        j = 1 + u
        temp -= Losg[u] * Losf[tempn // j]
        Highs += [temp]
    return Los, Highs


Losf, Highsf = [k for k in range(1 + s)], [0] + [Lim // k for k in range(1, 1 + s)]
Losg, Highsg = [k for k in range(1 + s)], [0] + [Lim // k for k in range(1, 1 + s)]

Lows, Highs = DirMult(Losf, Highsf, Losg, Highsg, Lim)

print(Highs[1])
print(default_timer() - start)

We'll see how to use this code. To use the function $\text{DirMult}$, we need four parameters. These parameters defined as below.

$\text{Losf}[k]=F(k)$, $\text{Highsf}[k]=F\left(\left\lfloor\frac{n}{k}\right\rfloor\right)$, $\text{Losg}[k]=G(k)$, and $\text{Highsg}[k]=G\left(\left\lfloor\frac{n}{k}\right\rfloor\right)$

We get two outputs and they too are interpreted the same way.

$\text{Los}[k]=H(k)$, $\text{Highs}[k]=H\left(\left\lfloor\frac{n}{k}\right\rfloor\right)$

In the example code above, we have $F(s)=G(s)=\zeta(s)$. Therefore, the output we get is the Divisor Summatory function.

Note that as the algorithm is made for an almost no-brainer approach. It doesn't take advantage of the properties of the functions that we are multiplying and hence the increased runtime.

I'll see you in the next post with Division of Dirichlet Series.


Until then
Yours Aye
Me

Monday, April 10, 2017

Divisor functions - Continued..


This post continues the discussion we had in my previous post.

I discussed only $k=0$ case before dismissing the others as uninteresting. They aren't after all. After some further work, I think I've figured out how the first DGF given above generalized to the other cases as well.

Following the same notations given before we have,

$\displaystyle\sum_{n=1}^\infty\frac{\sigma_k(m\cdot n)}{n^s}=\zeta(s)\zeta(s-k) \prod_{p_j|m}\left(1+(p_j^{k}+p_j^{2k}+p_j^{3k}+\cdots+p_j^{m_jk})(1-p_j^{-s})\right)$

Quite simple after all!! But I don't think the second DGF simplifies as nicely. That should be one for another post. But there is something else.

The first formula given in the previous post works even when $n$ is replaced by $n^2$. We are gonna make that replacement because of the closed form DGF we have for $\sigma_k(n^2)$.

Again following the same notations, this time we have,

$\displaystyle\sum_{n=1}^\infty\frac{\sigma_k(m\cdot n^2)}{n^s}=\frac{\zeta(s)\zeta(s-2k)\zeta(s-k)}{\zeta(2s-2k)} \prod_{p_j|m}\left(1+(p_j^{k}+p_j^{2k}+\cdots+p_j^{m_jk})\left(\frac{1-p_j^{-s}}{1+p_j^{-(s-k)}}\right)\right)$

As before, these DGFs can be used in combination with Dirichlet's Hyperbola method to find their summatory functions. Hope you find these interesting and worth your while. See ya soon.

Till then
Yours Aye,
Me