Rewriting a Prime Recurrence Relation

187 Views Asked by At

Let $p_j$ be the $j$th prime. Consider $$S(k,i) = \sum_{j=i}^{\infty}p_j S(k-p_j,j)$$

So that $$S(k,0) = 2 S(k-2, 0) + 3S(k-3, 1) + 5S(k-5, 2) + \cdots$$

Experimenting with this sum I get $$S(k,0) = 2S(k-2,0) + S(k,1) \implies S(k,1) = S(k,0) - 2S(k-2,0)$$

So we can rewrite $S(k-3,1) = \color{red}{S(k-3,0)-2S(k-5,0)}$ and we rewrite the second term of $S(k,0)$ in terms of $S(\cdot,0)$:

$$S(k,0) = 2S(k-2,0) + 3(\color{red}{S(k-3,0)-2S(k-5,0)}) + \cdots$$

Similarly $$S(k,0) = 2S(k-2,0) + 3S(k-3,1) + S(k,2) \\\implies S(k,2) = S(k,0) - 2S(k-2,0) - 3(S(k-3,0) - 2S(k-5,0))$$

With the eventual goal to express $S(k,0)$ entirely in terms of $S(\cdot,0)$.

Are there any resources where I can learn about this sort of rewriting algorithm? I assume I'm not the first to come up with this specific example. A connection between the OEIS sequence in Barry Cipra's answer and the formula for $S(k, 0)$ is appreciated.

1

There are 1 best solutions below

1
On

This is only a very partial answer, but it might help point the way.

The basic recursion is

$$S(k,i+1)=S(k,i)-p_iS(k-p_i,i)$$

where $p_0,p_1,p_2,\ldots=2,3,5,\ldots$ are the primes. (Note, the OP's indexing is somewhat nonstandard, in that $2$ is the "$0$th" prime; it's more common to consider it the first prime, but I will adhere to the OP's notation, so as not to confuse things.)

As the OP found, we have

$$S(k,1)=S(k,0)-2S(k-2,0)$$

and

$$\begin{align} S(k,2) &=S(k,1)-3S(k-3,i)\\ &=S(k,0)-2S(k-2,0)-3(S(k-3,0)-2S(k-5,0))\\ &=S(k,0)-2S(k-2,0)-3S(k-3,0)+6S(k-5,0) \end{align}$$

Continuing, we have

$$\begin{align} S(k,3) &=S(k,2)-5S(k-5,2)\\ &=S(k,0)-2S(k-2,0)-3S(k-3,0)+6S(k-5,0)\\ &\qquad-5(S(k-5,0)-2S(k-7,0)-3S(k-8,0)+6S(k-10,0))\\ &=S(k,0)-2S(k-2,0)-3S(k-3,0)+S(k-5,0)+10S(k-7,0)+15S(k-8,0)\\ &\qquad-30S(k-10,0) \end{align}$$

At this point let's abbreviate the notation to

$$\begin{align} S(k,1)&=S_0-2S_2\\ S(k,2)&=S_0-2S_2-3S_3+6S_5\\ S(k,3)&=S_0-2S_2-3S_3+S_5+10S_7+15S_8-30S_{10} \end{align}$$

where $S_n=S(k-n,0)$. Let's try one more:

$$\begin{align} S(k,4) &=S(k,3)-7S(k-7,3)\\ &=S_0-2S_2-3S_3+S_5+10S_7+15S_8-30S_{10}\\ &\qquad-7(S_7-2S_9-3S_{10}+S_{12}+10S_{14}+15S_{15}-30S_{17})\\ &=S_0-2S_2-3S_3+S_5+3S_7+15S_8+14S_9-9S_{10}-7S_{12}-70S_{14}-105S_{15}+210S_{17} \end{align}$$

It's becoming clear that for $i+1\ge4$ we will have

$$S(k,i+1)=S_0-2S_2-3S_3+S_5+3S_7+15S_8+14S_9-9S_{10}+\cdots$$

because the recursion equation doesn't change any of the first $p_i$ $S_k$'s.

Inserting coefficients $0$ for $S_1$, $S_4$, and $S_6$, we get the sequence

$$1,0,-2,-3,0,1,0,3,15,14,-9,\ldots$$

which agrees with A298159 at OEIS. Note, however, that only the beginning of each formula $S(k,i+1)=\sum_n a_nS_n$ starts out with these coefficients, so even if it can be proved that A298159 continues to agree with coefficients $a_n$ with $n\lt p_i$ (which seems likely), there's still work to be done.

Remark: All I did here, really, was to compute a couple more examples of the OP's recursion, notice that the coefficients were "stabilizing" to some sequence, and then check for that sequence on the OEIS. I was lucky to find what appears to be the right sequence, because normally I make mistakes and get at least one coefficient wrong in any computation I do. It was only after the fact that I clicked on the OP's link to OEIS and saw they had apparently noticed the same stabilizing property; they just hadn't done enough examples to narrow down the list of possible sequences.