0

How can I transform a formula describing a curve (a discrete series) to the standard formula for a geometric progression?

(Note: Maths is still very much a foreign language to me. I could be using any of these terms incorrectly. I could be using mathematical notation incorrectly. I could be using MathJax incorrectly. I am trying to describe computer code in mathematical language, and may have any of the translation wrong.)

The existing function computes a sum that is expressed as (I think) the following:

$$ \sum_{k=1}^{n} ({x}+({y}({k-1})^{z})) $$

  • $n$ is an input to the function. It is always an integer > 0.

  • $x$, $y$, $z$ are known (static) parameters in the function.

    • In this specific program, $z$ is typically a negative number, such as $-1.1$.
  • The function produces the sum of the series, for a given $n$.

Currently I have a function that does this via iterative addition. I want instead to use the sum of geometric series formula:

$$ \sum_{k=1}^{n} ar^{k-1} = \frac{a(1-r^{n})}{1-r} $$

What I can't figure out is how to transform this so that:

  • The formula meets the geometric series formula, so that $x$, $y$, $z$ are encapsulated instead as appropriate values for $a$ and $r$.

  • The $n$ retains the same value i the geometric series formula, so that existing users of this function can feed the same $n$ and get the same result.

If there's some standard transformations that will make this easier, I simply don't know them. I can noodle around in a spreadsheet and watch the plotted results change for n=[1..1000000], but don't understand the mathematical basis of those effects.

How (preferably explaining what the transformation means) do I transform the $x$, $y$, $z$ from the initial expression, to the $a$ and $r$ of the geometric series expression?

bignose
  • 137
  • Isn´t it obvious that $\sum\limits_{k=1}^{n} {x}=n\cdot x$? – callculus42 Dec 31 '18 at 05:48
  • Also note that $\sum_{k=1}^{n} ar^{\color{red}k} = \frac{a\cdot \color{red}r \cdot (1-r^{n})}{1-r}$ – callculus42 Dec 31 '18 at 05:55
  • @callculus, that's not the same expression though? I think maybe my initial expression is ambiguous; I've added more parentheses to better show what's grouped with what. – bignose Dec 31 '18 at 05:56
  • But you still just add $x$ n-times. You can write $\sum_{k=1}^{n} {x}+ y\cdot \sum_{k=1}^{n} ({k-1})^{z}$ as well. – callculus42 Dec 31 '18 at 05:57
  • @callculus, care to set out an answer? I'm going to need more explanation, I fear :-) – bignose Dec 31 '18 at 06:00
  • I´m finished, bignose. – callculus42 Dec 31 '18 at 06:18
  • Is $z$ a positive integer ? Whet is its range ? – Claude Leibovici Dec 31 '18 at 07:18
  • If $z$ is negative, when $k=1$ you have division-by-zero. I assume you have translated your program to math incorrectly (should $k$ start at $2$?). In any case, as Claude implied, this is not a Geometric Series since the base is changing in each term of the sum, not the exponent. I did a quick search and I didn't see efficient approximations for the generalized harmonic numbers that appear, so you won't be able to do better than your original code, except for applying a fact like $\sum_{k=2}^nx=(n-1)x$ or similar. – Mark S. Jan 03 '19 at 01:39

2 Answers2

2

If your formula $$S=\sum_{k=1}^{n} ({x}+({y}({k-1})^{z}))$$ is correct, I do not see what you can do except writing (assuming $z >0$) $$S=\sum_{k=1}^{n} x+ y \sum_{k=1}^{n} (k-1)^z=nx+y\sum_{k=2}^{n} (k-1)^z=nx+y\, H_{n-1}^{(-z)}$$ where appear generalized harmonic numbers.

For sure, for a given integer value of $z$, you can use Faulhaber's formulae. If this is the case, you will find the expressions for $z=1,2,\cdots,10$. If you need for larger values of $z$, it is possible to generate them for you in explicit forms easy to code.

1

Synthesising from @Claude-Leibovici and @Mark-S:

This is not a Geometric Series since the base is changing in each term of the sum, not the exponent. So, the expression cannot be transformed to the standard geometric progression.

bignose
  • 137