ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 28 Aug 2018 17:37:27 +0200How can I calculate this sum? (accept both sage(cocalc) and by hand)https://ask.sagemath.org/question/43364/how-can-i-calculate-this-sum-accept-both-sagecocalc-and-by-hand/ How can I calculate this sum?
1/1-(x+x^2)^2
* This is the sum of infinity formula : a/1-r, while a=1 and r=(x+x^2)^2
Please also confirm if my formula is right.Mon, 13 Aug 2018 18:24:41 +0200https://ask.sagemath.org/question/43364/how-can-i-calculate-this-sum-accept-both-sagecocalc-and-by-hand/Comment by Emmanuel Charpentier for <p>How can I calculate this sum?</p>
<p>1/1-(x+x^2)^2</p>
<ul>
<li>This is the sum of infinity formula : a/1-r, while a=1 and r=(x+x^2)^2
Please also confirm if my formula is right.</li>
</ul>
https://ask.sagemath.org/question/43364/how-can-i-calculate-this-sum-accept-both-sagecocalc-and-by-hand/?comment=43367#post-id-43367I'm afraid that your formula is *not* correct :
sage: var("r")
r
sage: (1/(1-r)).maxima_methods().powerseries(r,0)
sum(r^i1, i1, 0, +Infinity)
This can be shown in an elementary fashion by doing the "long division" of 1 by (1-r) "by hand"...
Could you restate your question a bit more clearly ? Xhat is summed, for what variable ?Mon, 13 Aug 2018 19:19:46 +0200https://ask.sagemath.org/question/43364/how-can-i-calculate-this-sum-accept-both-sagecocalc-and-by-hand/?comment=43367#post-id-43367Comment by Dox for <p>How can I calculate this sum?</p>
<p>1/1-(x+x^2)^2</p>
<ul>
<li>This is the sum of infinity formula : a/1-r, while a=1 and r=(x+x^2)^2
Please also confirm if my formula is right.</li>
</ul>
https://ask.sagemath.org/question/43364/how-can-i-calculate-this-sum-accept-both-sagecocalc-and-by-hand/?comment=43371#post-id-43371What's your formula equal to???Mon, 13 Aug 2018 20:19:52 +0200https://ask.sagemath.org/question/43364/how-can-i-calculate-this-sum-accept-both-sagecocalc-and-by-hand/?comment=43371#post-id-43371Comment by pizza for <p>How can I calculate this sum?</p>
<p>1/1-(x+x^2)^2</p>
<ul>
<li>This is the sum of infinity formula : a/1-r, while a=1 and r=(x+x^2)^2
Please also confirm if my formula is right.</li>
</ul>
https://ask.sagemath.org/question/43364/how-can-i-calculate-this-sum-accept-both-sagecocalc-and-by-hand/?comment=43381#post-id-43381My formula is equal to a/(1-r), for that is for adding a certain sequence to infinity. So now I have to apply to 1/1-(x+x^2)^2.Wed, 15 Aug 2018 08:47:17 +0200https://ask.sagemath.org/question/43364/how-can-i-calculate-this-sum-accept-both-sagecocalc-and-by-hand/?comment=43381#post-id-43381Comment by pizza for <p>How can I calculate this sum?</p>
<p>1/1-(x+x^2)^2</p>
<ul>
<li>This is the sum of infinity formula : a/1-r, while a=1 and r=(x+x^2)^2
Please also confirm if my formula is right.</li>
</ul>
https://ask.sagemath.org/question/43364/how-can-i-calculate-this-sum-accept-both-sagecocalc-and-by-hand/?comment=43382#post-id-43382Do you mean "That" when you type "Xhat"? (to Emmanuel Charpentier)Wed, 15 Aug 2018 08:50:46 +0200https://ask.sagemath.org/question/43364/how-can-i-calculate-this-sum-accept-both-sagecocalc-and-by-hand/?comment=43382#post-id-43382Comment by pizza for <p>How can I calculate this sum?</p>
<p>1/1-(x+x^2)^2</p>
<ul>
<li>This is the sum of infinity formula : a/1-r, while a=1 and r=(x+x^2)^2
Please also confirm if my formula is right.</li>
</ul>
https://ask.sagemath.org/question/43364/how-can-i-calculate-this-sum-accept-both-sagecocalc-and-by-hand/?comment=43432#post-id-43432Anyone could answer me after all?Tue, 21 Aug 2018 07:21:08 +0200https://ask.sagemath.org/question/43364/how-can-i-calculate-this-sum-accept-both-sagecocalc-and-by-hand/?comment=43432#post-id-43432Answer by Dox for <p>How can I calculate this sum?</p>
<p>1/1-(x+x^2)^2</p>
<ul>
<li>This is the sum of infinity formula : a/1-r, while a=1 and r=(x+x^2)^2
Please also confirm if my formula is right.</li>
</ul>
https://ask.sagemath.org/question/43364/how-can-i-calculate-this-sum-accept-both-sagecocalc-and-by-hand/?answer=43503#post-id-43503I'm certain that the question is not correctly asked. Notice that in the sentence,
> How can I calculate this sum?
>
> 1/1-(x+x^2)^2
there is no sum at all!
However, it seems that the OP wants to know if the expresion
$$\frac{1}{1 - (x + x^2)^2} = \sum_{n = 0}^\infty (x + x^2)^{2n},$$
is valid.
If that is the question... I'd say yes, as long as $(x + x^2)^2 <1.$Tue, 28 Aug 2018 15:09:20 +0200https://ask.sagemath.org/question/43364/how-can-i-calculate-this-sum-accept-both-sagecocalc-and-by-hand/?answer=43503#post-id-43503Answer by slelievre for <p>How can I calculate this sum?</p>
<p>1/1-(x+x^2)^2</p>
<ul>
<li>This is the sum of infinity formula : a/1-r, while a=1 and r=(x+x^2)^2
Please also confirm if my formula is right.</li>
</ul>
https://ask.sagemath.org/question/43364/how-can-i-calculate-this-sum-accept-both-sagecocalc-and-by-hand/?answer=43504#post-id-43504It seems you want the power series expansion of $1 / (1 - (x + x^2)^2))$.
It is not clear if you want the first few terms of this power series, or a formula for the general term.
To get the first few terms, you can use the method `.series()`.
sage: x = SR.var('x')
sage: f = 1/(1-(x+x^2)^2)
sage: f.series(x)
1 + 1*x^2 + 2*x^3 + 2*x^4 + 4*x^5 + 7*x^6 + 10*x^7 + 17*x^8 + 28*x^9 + 44*x^10
+ 72*x^11 + 117*x^12 + 188*x^13 + 305*x^14 + 494*x^15 + 798*x^16 + 1292*x^17
+ 2091*x^18 + 3382*x^19 + Order(x^20)
See also [OEIS sequence A094686](https://oeis.org/A094686) for more on this series.Tue, 28 Aug 2018 17:37:27 +0200https://ask.sagemath.org/question/43364/how-can-i-calculate-this-sum-accept-both-sagecocalc-and-by-hand/?answer=43504#post-id-43504