Calculating sum of consecutive powers of a number
$begingroup$
Here is my problem, I want to compute the $$sum_{i=0}^n P^i : Pin ℤ_{>1}$$
I know I can implement it using an easy recursive function, but since I want to use the formula in a spreadsheet, is there a better approach to this?
Thanks.
summation exponentiation
$endgroup$
add a comment |
$begingroup$
Here is my problem, I want to compute the $$sum_{i=0}^n P^i : Pin ℤ_{>1}$$
I know I can implement it using an easy recursive function, but since I want to use the formula in a spreadsheet, is there a better approach to this?
Thanks.
summation exponentiation
$endgroup$
add a comment |
$begingroup$
Here is my problem, I want to compute the $$sum_{i=0}^n P^i : Pin ℤ_{>1}$$
I know I can implement it using an easy recursive function, but since I want to use the formula in a spreadsheet, is there a better approach to this?
Thanks.
summation exponentiation
$endgroup$
Here is my problem, I want to compute the $$sum_{i=0}^n P^i : Pin ℤ_{>1}$$
I know I can implement it using an easy recursive function, but since I want to use the formula in a spreadsheet, is there a better approach to this?
Thanks.
summation exponentiation
summation exponentiation
asked Oct 13 '14 at 14:44


sasanjsasanj
58114
58114
add a comment |
add a comment |
4 Answers
4
active
oldest
votes
$begingroup$
If we call the sum $S_n$, then $$P cdot S_n = P + P^2 + P^3 + cdots + P^{n+1} = S_{n} + (P^{n+1} - 1).$$
Solving for $S_n$ we find: $$(P - 1) S_n = P^{n+1} - 1$$ and $$S_n = frac{P^{n+1}-1}{P-1}$$
This is a partial sum of a geometric series.
$endgroup$
3
$begingroup$
Thank you very much. What a dump I was! Back to elementary mathematics.
$endgroup$
– sasanj
Oct 13 '14 at 14:56
$begingroup$
I am glad I could help
$endgroup$
– Joel
Oct 13 '14 at 14:56
add a comment |
$begingroup$
The elements of your sum follow a geometric rule. It happens that the sum of a geometric series has a simple formula (if $P$ is not $1$) :
$$sum_{i=0}^n P^i = dfrac{P^{n+1} -1}{P-1}$$
EDIT : Let's prove this !
$(P-1)(P^n +P^{n-1}+...+1)= (P^{n+1} -P^n) +(P^n -P^{n-1})+(P^{n-1}-P^{n-2}) +...+(P-1) = P^{n+1} -1$
You have the result by dividing both sides by $P-1$.
$endgroup$
$begingroup$
Thanks for answering that fast. But is there a mathematical proof you can point me to?
$endgroup$
– sasanj
Oct 13 '14 at 14:50
add a comment |
$begingroup$
That's a geometric series. There are $n+1$ terms starting from the first term of $P^0 = 1$, and the sum is given by $displaystyle frac{P^{n+1}-1}{P-1}$
$endgroup$
add a comment |
$begingroup$
We have
$$begin{array}{l}
S_n&=1+P+P^2+P^3+cdots+P^n\
Pcdot S_n&=0+P+P^2+P^3+cdots+P^n+P^{n+1}
end{array}$$
Subtracting two above equations gives
$$
S_n-Pcdot S_n=1-P^{n+1}
$$
divide by $S_n$
$$
1-P=dfrac{1-P^{n+1}}{S_n}\
S_n=dfrac{1-P^{n+1}}{1-P}
$$
$endgroup$
$begingroup$
This is of course correct. But it's a duplicate of the three other good answers to this three year old question. You're an experienced user of the site, asking questions and accepting answers. Why not spend your answering time on new questions?
$endgroup$
– Ethan Bolker
Oct 21 '17 at 13:50
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f971761%2fcalculating-sum-of-consecutive-powers-of-a-number%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
If we call the sum $S_n$, then $$P cdot S_n = P + P^2 + P^3 + cdots + P^{n+1} = S_{n} + (P^{n+1} - 1).$$
Solving for $S_n$ we find: $$(P - 1) S_n = P^{n+1} - 1$$ and $$S_n = frac{P^{n+1}-1}{P-1}$$
This is a partial sum of a geometric series.
$endgroup$
3
$begingroup$
Thank you very much. What a dump I was! Back to elementary mathematics.
$endgroup$
– sasanj
Oct 13 '14 at 14:56
$begingroup$
I am glad I could help
$endgroup$
– Joel
Oct 13 '14 at 14:56
add a comment |
$begingroup$
If we call the sum $S_n$, then $$P cdot S_n = P + P^2 + P^3 + cdots + P^{n+1} = S_{n} + (P^{n+1} - 1).$$
Solving for $S_n$ we find: $$(P - 1) S_n = P^{n+1} - 1$$ and $$S_n = frac{P^{n+1}-1}{P-1}$$
This is a partial sum of a geometric series.
$endgroup$
3
$begingroup$
Thank you very much. What a dump I was! Back to elementary mathematics.
$endgroup$
– sasanj
Oct 13 '14 at 14:56
$begingroup$
I am glad I could help
$endgroup$
– Joel
Oct 13 '14 at 14:56
add a comment |
$begingroup$
If we call the sum $S_n$, then $$P cdot S_n = P + P^2 + P^3 + cdots + P^{n+1} = S_{n} + (P^{n+1} - 1).$$
Solving for $S_n$ we find: $$(P - 1) S_n = P^{n+1} - 1$$ and $$S_n = frac{P^{n+1}-1}{P-1}$$
This is a partial sum of a geometric series.
$endgroup$
If we call the sum $S_n$, then $$P cdot S_n = P + P^2 + P^3 + cdots + P^{n+1} = S_{n} + (P^{n+1} - 1).$$
Solving for $S_n$ we find: $$(P - 1) S_n = P^{n+1} - 1$$ and $$S_n = frac{P^{n+1}-1}{P-1}$$
This is a partial sum of a geometric series.
answered Oct 13 '14 at 14:50
JoelJoel
14.3k12240
14.3k12240
3
$begingroup$
Thank you very much. What a dump I was! Back to elementary mathematics.
$endgroup$
– sasanj
Oct 13 '14 at 14:56
$begingroup$
I am glad I could help
$endgroup$
– Joel
Oct 13 '14 at 14:56
add a comment |
3
$begingroup$
Thank you very much. What a dump I was! Back to elementary mathematics.
$endgroup$
– sasanj
Oct 13 '14 at 14:56
$begingroup$
I am glad I could help
$endgroup$
– Joel
Oct 13 '14 at 14:56
3
3
$begingroup$
Thank you very much. What a dump I was! Back to elementary mathematics.
$endgroup$
– sasanj
Oct 13 '14 at 14:56
$begingroup$
Thank you very much. What a dump I was! Back to elementary mathematics.
$endgroup$
– sasanj
Oct 13 '14 at 14:56
$begingroup$
I am glad I could help
$endgroup$
– Joel
Oct 13 '14 at 14:56
$begingroup$
I am glad I could help
$endgroup$
– Joel
Oct 13 '14 at 14:56
add a comment |
$begingroup$
The elements of your sum follow a geometric rule. It happens that the sum of a geometric series has a simple formula (if $P$ is not $1$) :
$$sum_{i=0}^n P^i = dfrac{P^{n+1} -1}{P-1}$$
EDIT : Let's prove this !
$(P-1)(P^n +P^{n-1}+...+1)= (P^{n+1} -P^n) +(P^n -P^{n-1})+(P^{n-1}-P^{n-2}) +...+(P-1) = P^{n+1} -1$
You have the result by dividing both sides by $P-1$.
$endgroup$
$begingroup$
Thanks for answering that fast. But is there a mathematical proof you can point me to?
$endgroup$
– sasanj
Oct 13 '14 at 14:50
add a comment |
$begingroup$
The elements of your sum follow a geometric rule. It happens that the sum of a geometric series has a simple formula (if $P$ is not $1$) :
$$sum_{i=0}^n P^i = dfrac{P^{n+1} -1}{P-1}$$
EDIT : Let's prove this !
$(P-1)(P^n +P^{n-1}+...+1)= (P^{n+1} -P^n) +(P^n -P^{n-1})+(P^{n-1}-P^{n-2}) +...+(P-1) = P^{n+1} -1$
You have the result by dividing both sides by $P-1$.
$endgroup$
$begingroup$
Thanks for answering that fast. But is there a mathematical proof you can point me to?
$endgroup$
– sasanj
Oct 13 '14 at 14:50
add a comment |
$begingroup$
The elements of your sum follow a geometric rule. It happens that the sum of a geometric series has a simple formula (if $P$ is not $1$) :
$$sum_{i=0}^n P^i = dfrac{P^{n+1} -1}{P-1}$$
EDIT : Let's prove this !
$(P-1)(P^n +P^{n-1}+...+1)= (P^{n+1} -P^n) +(P^n -P^{n-1})+(P^{n-1}-P^{n-2}) +...+(P-1) = P^{n+1} -1$
You have the result by dividing both sides by $P-1$.
$endgroup$
The elements of your sum follow a geometric rule. It happens that the sum of a geometric series has a simple formula (if $P$ is not $1$) :
$$sum_{i=0}^n P^i = dfrac{P^{n+1} -1}{P-1}$$
EDIT : Let's prove this !
$(P-1)(P^n +P^{n-1}+...+1)= (P^{n+1} -P^n) +(P^n -P^{n-1})+(P^{n-1}-P^{n-2}) +...+(P-1) = P^{n+1} -1$
You have the result by dividing both sides by $P-1$.
edited Oct 13 '14 at 14:55
answered Oct 13 '14 at 14:48
TraklonTraklon
2,70711127
2,70711127
$begingroup$
Thanks for answering that fast. But is there a mathematical proof you can point me to?
$endgroup$
– sasanj
Oct 13 '14 at 14:50
add a comment |
$begingroup$
Thanks for answering that fast. But is there a mathematical proof you can point me to?
$endgroup$
– sasanj
Oct 13 '14 at 14:50
$begingroup$
Thanks for answering that fast. But is there a mathematical proof you can point me to?
$endgroup$
– sasanj
Oct 13 '14 at 14:50
$begingroup$
Thanks for answering that fast. But is there a mathematical proof you can point me to?
$endgroup$
– sasanj
Oct 13 '14 at 14:50
add a comment |
$begingroup$
That's a geometric series. There are $n+1$ terms starting from the first term of $P^0 = 1$, and the sum is given by $displaystyle frac{P^{n+1}-1}{P-1}$
$endgroup$
add a comment |
$begingroup$
That's a geometric series. There are $n+1$ terms starting from the first term of $P^0 = 1$, and the sum is given by $displaystyle frac{P^{n+1}-1}{P-1}$
$endgroup$
add a comment |
$begingroup$
That's a geometric series. There are $n+1$ terms starting from the first term of $P^0 = 1$, and the sum is given by $displaystyle frac{P^{n+1}-1}{P-1}$
$endgroup$
That's a geometric series. There are $n+1$ terms starting from the first term of $P^0 = 1$, and the sum is given by $displaystyle frac{P^{n+1}-1}{P-1}$
answered Oct 13 '14 at 14:50


DeepakDeepak
16.8k11436
16.8k11436
add a comment |
add a comment |
$begingroup$
We have
$$begin{array}{l}
S_n&=1+P+P^2+P^3+cdots+P^n\
Pcdot S_n&=0+P+P^2+P^3+cdots+P^n+P^{n+1}
end{array}$$
Subtracting two above equations gives
$$
S_n-Pcdot S_n=1-P^{n+1}
$$
divide by $S_n$
$$
1-P=dfrac{1-P^{n+1}}{S_n}\
S_n=dfrac{1-P^{n+1}}{1-P}
$$
$endgroup$
$begingroup$
This is of course correct. But it's a duplicate of the three other good answers to this three year old question. You're an experienced user of the site, asking questions and accepting answers. Why not spend your answering time on new questions?
$endgroup$
– Ethan Bolker
Oct 21 '17 at 13:50
add a comment |
$begingroup$
We have
$$begin{array}{l}
S_n&=1+P+P^2+P^3+cdots+P^n\
Pcdot S_n&=0+P+P^2+P^3+cdots+P^n+P^{n+1}
end{array}$$
Subtracting two above equations gives
$$
S_n-Pcdot S_n=1-P^{n+1}
$$
divide by $S_n$
$$
1-P=dfrac{1-P^{n+1}}{S_n}\
S_n=dfrac{1-P^{n+1}}{1-P}
$$
$endgroup$
$begingroup$
This is of course correct. But it's a duplicate of the three other good answers to this three year old question. You're an experienced user of the site, asking questions and accepting answers. Why not spend your answering time on new questions?
$endgroup$
– Ethan Bolker
Oct 21 '17 at 13:50
add a comment |
$begingroup$
We have
$$begin{array}{l}
S_n&=1+P+P^2+P^3+cdots+P^n\
Pcdot S_n&=0+P+P^2+P^3+cdots+P^n+P^{n+1}
end{array}$$
Subtracting two above equations gives
$$
S_n-Pcdot S_n=1-P^{n+1}
$$
divide by $S_n$
$$
1-P=dfrac{1-P^{n+1}}{S_n}\
S_n=dfrac{1-P^{n+1}}{1-P}
$$
$endgroup$
We have
$$begin{array}{l}
S_n&=1+P+P^2+P^3+cdots+P^n\
Pcdot S_n&=0+P+P^2+P^3+cdots+P^n+P^{n+1}
end{array}$$
Subtracting two above equations gives
$$
S_n-Pcdot S_n=1-P^{n+1}
$$
divide by $S_n$
$$
1-P=dfrac{1-P^{n+1}}{S_n}\
S_n=dfrac{1-P^{n+1}}{1-P}
$$
edited Oct 21 '17 at 13:46
answered Oct 21 '17 at 13:39
BrightBright
200111
200111
$begingroup$
This is of course correct. But it's a duplicate of the three other good answers to this three year old question. You're an experienced user of the site, asking questions and accepting answers. Why not spend your answering time on new questions?
$endgroup$
– Ethan Bolker
Oct 21 '17 at 13:50
add a comment |
$begingroup$
This is of course correct. But it's a duplicate of the three other good answers to this three year old question. You're an experienced user of the site, asking questions and accepting answers. Why not spend your answering time on new questions?
$endgroup$
– Ethan Bolker
Oct 21 '17 at 13:50
$begingroup$
This is of course correct. But it's a duplicate of the three other good answers to this three year old question. You're an experienced user of the site, asking questions and accepting answers. Why not spend your answering time on new questions?
$endgroup$
– Ethan Bolker
Oct 21 '17 at 13:50
$begingroup$
This is of course correct. But it's a duplicate of the three other good answers to this three year old question. You're an experienced user of the site, asking questions and accepting answers. Why not spend your answering time on new questions?
$endgroup$
– Ethan Bolker
Oct 21 '17 at 13:50
add a comment |
Thanks for contributing an answer to Mathematics Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f971761%2fcalculating-sum-of-consecutive-powers-of-a-number%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown