Viết chương trình tính tổng sau:
\(\dfrac{1}{1.3}\)+\(\dfrac{1}{2.4}\)+\(\dfrac{1}{3.5}\)+...\(\dfrac{1}{n\left(n+2\right)}\)
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.
Thuật toán:
Bước 1: Nhập n
Bước 2: i←1; a←0;
Bước 3: a←a+1/(i*(i+2));
Bước 4: i←i+1;
Bước 5: Nếu i<=n thì quay lại bước 3
Bước 6: xuất a
Bước 7: Kết thúc
Viết chương trình:
uses crt;
var a:real;
i,n:longint;
begin
clrscr;
write('Nhap n='); readln(n);
a:=0;
for i:=1 to n do
a:=a+1/(i*(i+2));
writeln(a:4:2);
readln;
end.
uses crt;
var b:array[1..100] of integer;
i,n,d:integer;
begin
clrscr;
repeat
writeln('nhap n=');readln(n);
until n>0;
for i:=1 to n do
begin writeln('b[',i,']','=');readln(b[i]);end;
writeln('so cac so le la');
for i:=1 to n do
if b[i] mod 2<>0 then d:=d+1;
writeln(d);readln;end.
uses crt;
var n,i:longint; s:real;
begin
clrscr;
s:=0;
writeln('nhap vao n=');readln(n);
writeln('tong cua A la');
for i:=1 to n do
s:=s + 1/(i*(i+2));
writeln(s:4:3);readln;end.
\(\left(1+\dfrac{1}{1.3}\right).\left(1+\dfrac{1}{2.4}\right).\left(1+\dfrac{1}{3.5}\right).........\left[1+\dfrac{1}{x.\left(x+2\right)}\right]=\dfrac{31}{16}\)
\(\Rightarrow\dfrac{2^2}{1.3}.\dfrac{3^2}{2.4}.\dfrac{4^2}{3.5}........\dfrac{\left(x+1\right)^2}{x.\left(x+2\right)}=\dfrac{31}{16}\)
\(\Rightarrow\dfrac{\left[2.3.4.............\left(x+1\right)\right].\left[2.3.4.............\left(x+1\right)\right]}{\left(1.2.3...................x\right).\left(3.4.5..........................\left(x+2\right)\right)}=\dfrac{31}{16}\)
\(\Rightarrow\dfrac{\left(x+1\right).2}{1.\left(x+2\right)}=\dfrac{31}{16}\)
\(\Leftrightarrow16.2\left(x+1\right)=31.\left(x+2\right)\)
\(\Rightarrow32x+32=31x+62\)
\(\Rightarrow x=30\)
Vậy x=30
Chúc bn học tốt
\(A=\dfrac{1}{2}\left(2.\dfrac{2}{3}\right)\left(\dfrac{3}{2}.\dfrac{3}{4}\right)\left(\dfrac{4}{3}.\dfrac{4}{5}\right)....\left(\dfrac{2016}{2015}.\dfrac{2016}{2017}\right)\)
\(=\dfrac{2016}{2017}\)
\(A=\dfrac{1}{2}.\left(1+\dfrac{1}{1.3}\right)\left(1+\dfrac{1}{2.4}\right)\left(1+\dfrac{1}{3.5}\right)....\left(\dfrac{1}{2015.2017}\right)\)
\(=\dfrac{1}{2}\left(\dfrac{2}{1}.\dfrac{2}{3}\right).\left(\dfrac{3}{2}.\dfrac{3}{4}\right).\left(\dfrac{4}{3}.\dfrac{4}{5}\right)....\left(\dfrac{2016}{2015}.\dfrac{2016}{2017}\right)\)
\(=\dfrac{1}{2}.\left(\dfrac{2}{1}.\dfrac{2}{3}\right).\left(\dfrac{3}{2}.\dfrac{3}{4}\right).\left(\dfrac{4}{3}.\dfrac{4}{5}\right).....\left(\dfrac{2016}{2015}.\dfrac{2016}{2017}\right)\)
\(=\dfrac{2016}{2017}\)
\(A=\dfrac{1}{2}\left(\dfrac{2.2}{1.3}\right).\left(\dfrac{3.3}{2.4}\right)...\left(\dfrac{2020.2020}{2019.2021}\right)\)
\(=\dfrac{1.2.2.3.3...2020.2020}{1.2.2.3.3.4.4...2019.2021}\)
\(=\dfrac{1}{2021}\)
\(A=\dfrac{1}{2}\cdot\left(1+\dfrac{1}{1\cdot3}\right)\left(1+\dfrac{1}{2\cdot4}\right)\left(1+\dfrac{1}{3\cdot5}\right)...\left(1+\dfrac{1}{2019\cdot2021}\right)\)
\(A=\dfrac{1}{2}\left(1+\dfrac{1}{2^2-1}\right)\left(1+\dfrac{1}{3^2-1}\right)\left(1+\dfrac{1}{4^2-1}\right)...\left(1+\dfrac{1}{2020^2-1}\right)\)
\(A=\dfrac{1}{2}\cdot\dfrac{2^2}{\left(2-1\right)\left(2+1\right)}\cdot\dfrac{3^2}{\left(3-1\right)\cdot\left(3+1\right)}...\left(\dfrac{2020^2}{\left(2020-1\right)\cdot\left(2020+1\right)}\right)\)
\(A=\dfrac{1}{2}\cdot\dfrac{2}{1}\cdot\dfrac{2}{3}\cdot\dfrac{3}{2}\cdot\dfrac{3}{4}\cdot...\cdot\dfrac{2020}{2019}\cdot\dfrac{2020}{2021}\)
\(A=\dfrac{1}{2}\cdot\dfrac{2}{1}\cdot\dfrac{3}{2}\cdot...\cdot\dfrac{2020}{2019}\cdot\dfrac{2}{3}\cdot\dfrac{3}{4}\cdot...\cdot\dfrac{2020}{2021}\)
\(A=\dfrac{1}{2}\cdot2020\cdot\dfrac{2}{2021}=\dfrac{2020}{2021}\)
uses crt;
var i,n:integer; S:real;
Begin
clrscr;
write('Nhap n: '); readln(n);
for i:=1 to n do S:=S+1/(i*(i+2));
writeln('Tong la: ',S:3:1);
readln
End.