tính s=(-1)^1*1+(-1)^2*2+(-1)^3*3+...+(-1)^n*n
Hãy nhập câu hỏi của bạn vào đây, nếu là tài khoản VIP, bạn sẽ được ưu tiên trả lời.
A = \(\frac{1}{3}+\frac{1}{3^2}+...+\frac{1}{3^{2007}}+\frac{1}{3^{2008}}\)
3A= \(1+\frac{1}{3}+...+\frac{1}{3^{2006}}+\frac{1}{3^{2007}}\)
3A-A= \(1-\frac{1}{3^{2008}}\)
1:
\(S=-\left(1-\dfrac{1}{10}+\dfrac{1}{10^2}-...-\dfrac{1}{10^{n-1}}\right)\)
\(=-\left[\left(-\dfrac{1}{10}\right)^0+\left(-\dfrac{1}{10}\right)^1+...+\left(-\dfrac{1}{10}\right)^{n-1}\right]\)
\(u_1=\left(-\dfrac{1}{10}\right)^0;q=-\dfrac{1}{10}\)
\(\left(-\dfrac{1}{10}\right)^0+\left(-\dfrac{1}{10}\right)^1+...+\left(-\dfrac{1}{10}\right)^{n-1}\)
\(=\dfrac{\left(-\dfrac{1}{10}\right)^0\left(1-\left(-\dfrac{1}{10}\right)^{n-1}\right)}{-\dfrac{1}{10}-1}\)
\(=\dfrac{1-\left(-\dfrac{1}{10}\right)^{n-1}}{-\dfrac{11}{10}}\)
=>\(S=\dfrac{1-\left(-\dfrac{1}{10}\right)^{n-1}}{\dfrac{11}{10}}\)
2:
\(S=\left(\dfrac{1}{3}\right)^0+\left(\dfrac{1}{3}\right)^1+...+\left(\dfrac{1}{3}\right)^{n-1}\)
\(u_1=1;q=\dfrac{1}{3}\)
\(S_{n-1}=\dfrac{1\cdot\left(1-\left(\dfrac{1}{3}\right)^{n-1}\right)}{1-\dfrac{1}{3}}\)
\(=\dfrac{3}{2}\left(1-\left(\dfrac{1}{3}\right)^{n-1}\right)\)
\(1,\) Ta có \(\left\{{}\begin{matrix}q=\dfrac{u_2}{u_1}=\dfrac{1}{10}:\left(-1\right)=-\dfrac{1}{10}\\u_1=-1\end{matrix}\right.\)
Vậy \(S=-1+\dfrac{1}{10}-\dfrac{1}{10^2}+...+\dfrac{\left(-1\right)^n}{10^{n-1}}=\dfrac{-1}{1-\left(-\dfrac{1}{10}\right)}=-\dfrac{10}{11}\)
\(2,\) Ta có \(\left\{{}\begin{matrix}q=\dfrac{u_2}{u_1}=\dfrac{1}{3}\\u_1=1\end{matrix}\right.\)
Vậy \(S=1+\dfrac{1}{3}+\dfrac{1}{3^2}+...+\dfrac{1}{3^{n-1}}=\dfrac{1}{1-\dfrac{1}{3}}=\dfrac{3}{2}\)
a: uses crt;
var s,i,n:integer;
begin
clrscr;
readln(n);
s:=0;
for i:=1 to n do s:=s+i;
writeln(s);
readln;
end.
b:
uses crt;
var s:real;
i,n:integer;
begin
clrscr;
readln(n);
s:=0;
for i:=1 to n do
s:=s+1/i;
writeln(s:4:2);
readln;
end.
c:
uses crt;
var s:real;
i,n:integer;
begin
clrscr;
readln(n);
s:=0;
for i:=1 to n do
s:=s+1/i;
writeln(s+1/(n+1):4:2);
readln;
end.
uses crt;
var n,i:integer;
s:real;
//chuongtrinhcon
function gthua(n:integer):real;
var gt:real;
i:integer;
begin
gt:=1;
for i:=1 to n do
gt:=gt*i;
gthua:=gt;
end;
//chuongtrinhcon
function lthua(n,x:integer):real;
var lt:real;
i:integer;
begin
lt:=1;
for i:=1 to x do lt:=lt*x;
lthua:=lt;
end;
//chuongtrinhchinh
begin
clrscr;
readln(n);
s:=0;
for i:=1 to n do
s:=s+(lthua(i,i)/gthua(i));
writeln(s:4:2);
readln;
end.
Câu a:
n = int(input("Nhập số nguyên n: "))
S = 0
for i in range(1, n+1):
S += i
print("Tổng S =", S)
Câu b:
n = int(input("Nhập số nguyên n: "))
S = 0
for i in range(1, n, 2):
S += i
print("Tổng S =", S)
Câu c:
def calc_sum(n):
s=0
for i in range(1,n+1):
s += 2*i
return s
n = int(input("Nhập vào số n: "))
print("Tổng S=2+4+6+...2n là:",calc_sum(n))
n = int(input("Nhập số nguyên n: "))
S = 0
for i in range(1, n+1):
S += i
print("Tổng S =", S)
Câu b:
n = int(input("Nhập số nguyên n: "))
S = 0
for i in range(1, n, 2):
S += i
print("Tổng S =", S)
Câu c:
def calc_sum(n):
s=0
for i in range(1,n+1):
s += 2*i
return s
n = int(input("Nhập vào số n: "))
print("Tổng S=2+4+6+...2n là:",calc_sum(n))
S = 1 + 3 + 32 + 33 + ... + 330
3S = 3 + 32 + 33 + 34 + ... + 331
3S - S = ( 3 + 32 + 33 + 34 + ... + 331 ) - ( 1 + 3 + 32 + 33 + ... + 330 )
2S = 331 - 1
S = \(\frac{3^{31}-1}{2}\)
\(S=1+3+3^2+3^3+...+3^{30}\)
\(S=1+3\left(1+3^2+...+3^{29}\right)\)
\(S=1+3\left(S-3^{30}\right)\)
\(S=1+3S-3^{31}\)
\(2S=3^{31}-1\)
\(S=\frac{3^{31}-1}{2}\)
\(N=1+4+4^2+...+4^{132}=1+4\left(1+4^2+...+4^{131}\right)\)
\(N=1+3\left(N-4^{132}\right)\)
\(N=1+3N-4^{133}=\frac{4^{133}-1}{2}\)