Answer :
I hope this question is for java programing...
For that you can take 3 varaibles in one you can take value from user in other two you can perform task and then print that's all best of luck
For that you can take 3 varaibles in one you can take value from user in other two you can perform task and then print that's all best of luck
1.
[tex]1+(1+x)+(1+x+ x^{2} )+...=1+ \frac{x^2-1}{x-1} + \frac{x^3-1}{x-1}+ \frac{x^4-1}{x-1}+..+ \frac{x^{n}-1}{x-1} \\ =1+ \frac{x^2+x^3+..+x^{n}-(n-1)}{x-1}=1+ \frac{ \frac{x^{2}(x^{n-1}-1)}{x-1}-(n-1) }{x-1} [/tex]
2.
this sum is as i calculated till
[tex]= \frac{1}{2}- \frac{1}{2(3)(5)(7)(11)...n} [/tex]
[tex]1+(1+x)+(1+x+ x^{2} )+...=1+ \frac{x^2-1}{x-1} + \frac{x^3-1}{x-1}+ \frac{x^4-1}{x-1}+..+ \frac{x^{n}-1}{x-1} \\ =1+ \frac{x^2+x^3+..+x^{n}-(n-1)}{x-1}=1+ \frac{ \frac{x^{2}(x^{n-1}-1)}{x-1}-(n-1) }{x-1} [/tex]
2.
this sum is as i calculated till
[tex]= \frac{1}{2}- \frac{1}{2(3)(5)(7)(11)...n} [/tex]