1
$\begingroup$

Is there a formal name for

$ S(k,n) = \sum_{p = 1}^{n} k^p$

I tried to use the Online Encyclopedia of Integer Sequences but it returned 11036 results. Also this formula has two inputs and I don't know if/how to do that with OEIS.

TL;DR

This is for use with generating test cases with a computer program. I used Catalan number for generating the test cases for binary operators and am now expanding the generator to handle unary operators.

My first attempt to do this was when ever a unary operator was to be added was to add a binary operator with the second argument set to null, but that resulted in duplicate test cases.

As a check I would like to be able to calculate the number of correct test cases for unary operators using this function; as Catalan number worked correctly for binary operators.

The reason I seek the name is because once I have the name I can query with it and get more helpful web pages, e.g. querying with catalan number binary tree test cases quickly led to Every Binary Tree There Is

Yes I am aware that I will need to combine this with the outcome of the Catalan number, but I am taking this one step at a time.

Edits

Simplification formula noted by Hans Lundmark :

$ S(n,k) = \frac{k(k^n-1)}{(k-1)}$

  • 0
    ...it's known as the geometric series...2017-02-27
  • 0
    @SimplyBeautifulArt Thanks, but it is not specific enough. When using with [OEIS](http://oeis.org/search?q=geometric+series&sort=&language=&go=Search) it returns with 188 results.2017-02-27
  • 0
    ...ask Google on geometric series...2017-02-27
  • 0
    @SimplyBeautifulArt I actually used geometric series before posting the question and it turned up nothing useful in the first few pages of Googling related to generating test cases with unary operators or something similar.2017-02-27
  • 1
    Are you looking for numbers to use as test data, or what? For this sum, you can just use the formula for geometric sums: $S(n,k)=k(k^n-1)/(k-1)$ (if $k \neq 1$).2017-02-27
  • 0
    @HansLundmark No, I am looking for a specific name that I can Google with or that I can use with OEIS. Generating the numbers and using them is easy. Mostly I want to find a connection between this formula and generating test, but querying for a math formula never works for me as there is no normal form that works with Googling. e.g. k^p, n^k, the sum of a constant to a power, etc., just to many variations. If someone has done the code before hopefully they used the same formulas, this and Catalan number and posted it.2017-02-27
  • 0
    Well, “geometric sum” is the only phrase I can come up with to describe this formula, and obviously googling for that will give very broad results, so it's probably not very useful. But I have to admit that I still don't quite understand what it is that you're looking for...2017-02-27
  • 0
    @HansLundmark Thanks. I was hoping there would be a specific name but not expecting one. It is one of those questions that if you don't ask you may never know. You are probably overthinking about the question if you are still confused. It is nothing more than is there a specific name for this function. Apparently the answer is no. The easy ones throw me off at times too.2017-02-27
  • 0
    Your question seems pretty indirect. Why don't you just ask for the combinatorial formula that you need ?2017-02-27
  • 0
    Once again, this is very indirect. Knowing the number of test cases doesn't necessarily tell you how to generate them. Asking the true question will increase the probability of getting the true answer.2017-02-27
  • 0
    @YvesDaoust I know how to generate the test cases, I just don't want to generate duplicates. If I know the exact number that is expected by having a formula then after generating I can quickly tell if the generator is correct by seeing if the number generated is the same as given by the formula. I just want to make sure I have the right formula. I know I could ask a more direct question but this helps me learn more. Before I asked this question I suspected that there should be a relation with lattice walks, which I don't know, but now will look into more. Thanks. :).2017-02-27
  • 0
    "I know how to generate the test cases, I just don't want to generate duplicates": maybe you should summarize by "I don't know how to generate the test cases". Good luck.2017-02-27

3 Answers 3

0

While there appears to be no formal agreed upon name, OEIS provides a means that can be referenced and includes references to other sources of information.

From OEIS

A228275

$ \begin{array}{c|c|c|c|c|c|c|} & n & 1 & 2 & 3 & 4 & 5 \\ \hline k & & & & & & \\ \hline 1 & & 1 & 2 & 3 & 4 & 5 \\ \hline 2 & & 2 & 6 & 14 & 30 & 62 \\ \hline 3 & & 3 & 12 & 39 & 120 & 363 \\ \hline 4 & & 4 & 20 & 84 & 340 & 1364 \\ \hline 5 & & 5 & 30 & 155 & 780 & 3905 \\ \hline \end{array} $

Column 1: A001477
Column 2: A002378
Column 3: A027444
Column 4: A027445
Column 5: A152031

Row 1: A001477
Row 2: A000918
Row 3: A029858
Row 4: A080674

a(n) is the number of steps which are made when generating all n-step random walks that begin in a given point P on a two-dimensional square lattice. To make one step means to move along one edge on the lattice. - Pawel P. Mazur, Mar 10 2005

This is interesting because Catalan number also references lattice walk.

Row 5: A104891

  • 0
    Of interest: [Analytic Combinatorics](http://algo.inria.fr/flajolet/Publications/AnaCombi/book.pdf) by Philippe Flajolet Robert Sedgewick2017-03-04
  • 0
    Of interest: [OEIS index Rooted Tree](https://oeis.org/wiki/Index_to_OEIS:_Section_Ro#rooted)2017-03-04
1

This is a geometric series, with two pecularities

  • the exponents start at $1$ instead of $0$,

  • the would-be-zero-exponent-term is $1$ instead of some arbitrary constant.

As far as I know, there is no specific name for this case, and geometric series is an accurate expression. (Also sum of a geometric progression; it is unclear whether one or the other has a bias towards the infinite summation.)

All search engines will return loads of entries not because the term is vague, but because the topic raises a lot of interest.


Your way to describe this summation seems to imply that the common ratio $k$ is an integer and that one considers increasing values of $k$. This is not so natural, one usually deals with $$S(a,r,n)=\sum_{i=0}^n ar^i$$ where $a$ and $r$ are abitrary reals.

0

Maybe the term "sum of the first $n$ numbers of a geomtric progression with initial value $k$ and ratio $k$" is what you are looking for.

  • 0
    Thanks, but it doesn't return helpful results when Googling.2017-02-27
  • 0
    What kind of results would you consider useful?2017-02-28
  • 0
    I found the quote I put under row 4 to be useful because it references lattice walk which is also referenced with Catalan number.2017-02-28