# Closed form for $f(n+1)=f(n)+\sum _{a=1}^n \sum _{b=1}^n e^{n-a b}$?

I have an arithmetic function $$f$$ defined by the following recurrence relation:

$$f(n+1)=f(n)+\sum _{a=1}^n \sum _{b=1}^n e^{n-a b}$$

Is it possible to create a closed-form expression for $$f$$? I've been noodling around with generating functions, but I'm not sure if that's the right way to go about this. There are so many possibilities, and I don't know how to proceed.

I am aware that there are lots of questions on this forum about this general subject (recurrence $$\rightarrow$$ closed form), but I haven't found one that meets my specific needs. The issue, I suspect, is the double summation.

*BTW, I'm teaching myself all this stuff from scratch. Hints are appreciated, of course - but please be aware that I may not even understand the hint. My A-Level was in 1982, and since then, I've done no maths at all...

Hint.

$$\frac{f_{n+1}-f_n}{e^n}-\frac{f_{n}-f_{n-1}}{e^{n-1}}=2\frac{e^{-n(n+1)}-1}{e^{-n}-1}-e^{-n^2}-2$$

giving

$$f_n = c_1+c_2 e^n+e^n \sum _{k=0}^{n-1} \frac{e^{-(k+1)^2} \left(2 e^{(k+1)^2}-e^{k+1}-1\right)}{(e-1) \left(e^{k+1}-1\right)}-\sum _{j=0}^{n-1}\frac{e^{-(j+1)^2-j (j+1)+j+1} \left(2 e^{(j+1)^2+j (j+1)}-e^{j (j+1)}-e^{(j+1)^2}\right)}{(e-1) \left(e^{j+1}-1\right)}$$

NOTE

$$\sum_j^n\sum_k^n e^{-j k}-\sum_j^{n-1}\sum_k^{n-1} e^{-j k} = \sum_{j=1}^n e^{-nj}+\sum_{k=1}^n e^{-nk}-e^{-n^2}$$

where

$$\sum_{j=1}^n e^{-nj} = \frac{e^{-n(n+1)}-1}{e^{-n}-1}-1$$

hence

$$\sum_j^n\sum_k^n e^{-j k}-\sum_j^{n-1}\sum_k^{n-1} e^{-j k} = 2\frac{e^{-n(n+1)}-1}{e^{-n}-1}-e^{-n^2}-2$$

after that, consider $$g_n = \frac{f_{n+1}-f_n}{e^n}$$

• Hi @Cesareo. I'm very grateful for this, but the leaps are pretty big - probably obvious and intuitive to you, but still... I'd really appreciate it if you could break it down some more. – Richard Burke-Ward Jul 27 '19 at 15:14
• @RichardBurke-Ward Please. See attached note. – Cesareo Jul 27 '19 at 15:31
• Hi @Cesareo. Thanks again. I might need a bit of time to process this, since the day is ending here, and I have stuff I need to do. But I'm very grateful, and when I have got my head around it, I'll mark as answered. Hopefully no more questions! – Richard Burke-Ward Jul 27 '19 at 18:42
• Hi @Cesareo, I'm embarrassed to admit that I still need more help. It's clear that $\frac{f(n+1)-f(n)}{e^{-n}}-\frac{f(n)-f(n-1)}{e^{1-n}}=\sum _{a=1}^n \sum _{b=1}^n e^{-a b}-\sum _{a=1}^{n-1} \sum _{b=1}^{n-1} e^{-a b}$, but then I get $\sum _{a=1}^n \sum _{b=1}^n e^{-a b}-\sum _{a=1}^{n-1} \sum _{b=1}^{n-1} e^{-a b}=\sum _{a=n}^n \sum _{b=n}^n e^{-a b}=e^{-n^2}$. So, I'm clearly still missing something... – Richard Burke-Ward Jul 29 '19 at 11:52
• @RichardBurke-Ward I had considered the lower limit of the sums as being 0 when in reality it is 1. Thus I introduced the relevant changes. – Cesareo Jul 29 '19 at 13:10