Viết ch/tr tính S= \(\dfrac{1}{1\cdot3}+\dfrac{1}{2\cdot4}+\dfrac{1}{3\cdot5}+\dfrac{1}{4\cdot6}+...+\dfrac{1}{n\left(n+2\right)}\)
Với n nhập từ bàn phím
GIÚP MÌNH VỚI MAI MÌNH KIỂM TRA RÙI
Viết chương trình tính \(S=\dfrac{1}{1\cdot3}+\dfrac{1}{2\cdot4}+\dfrac{1}{3\cdot5}+\cdot\cdot\cdot\cdot\cdot+\dfrac{1}{n\left(n+2\right)}\)
program bai1;
var n,i:longint;s:real;
begin
write('N= ');readln(n);
s:=0;
for i:=1 to n do
s:=s+1/(i*(i+2));
writeln('Tong la ',s);
readln
end.
của Trương Quang Dũng thiếu uses crt;
ko khai báo s.
có 2 dấu ngoặc liên tiếp nên chương trình sẽ bị lỗi
Tính tổng:
\(\dfrac{1}{1\cdot2\cdot3}+\dfrac{1}{2\cdot3\cdot4}+\dfrac{1}{3\cdot4\cdot5}+...+\dfrac{1}{n\left(n+1\right)\left(n+2\right)}\)
Đặt A=\(\dfrac{1}{1.2.3}\)+\(\dfrac{1}{2.3.4}\)+\(\dfrac{1}{3.4.5}\)+...+\(\dfrac{1}{n\left(n+1\right)\left(n+2\right)}\)
=>2A=\(\dfrac{2}{1.2.3}\)+\(\dfrac{2}{2.3.4}\)+...+\(\dfrac{2}{n\left(n+1\right)\left(n+2\right)}\)
=\(\dfrac{1}{1.2}-\dfrac{1}{2.3}+\dfrac{1}{2.3}-\dfrac{1}{3.4}+...+\)\(\dfrac{1}{n\left(n+1\right)}-\dfrac{1}{\left(n+1\right)\left(n+2\right)}\)
=\(\dfrac{1}{2}-\dfrac{1}{\left(n+1\right)\left(n+2\right)}\)
=\(\dfrac{\left(n+1\right)\left(n+2\right)-2}{2\left(n+1\right)\left(n+2\right)}\)
=\(\dfrac{n^2+3n}{2\left(n^2+3n+2\right)}\)
=>A=\(\dfrac{n^2+3n}{4n^2+12n+8}\)
viết chương trình tính tổng s=1+\(\dfrac{1}{1\cdot2}\)+\(\dfrac{1}{2\cdot3}+\dfrac{1}{3\cdot4}\)+............+\(\dfrac{1}{n\left(n+1\right)}\)với n là số nguyên nhập từ bàn phím.
var i,n:integer;
s:real;
begin
s:=1;
write('ban hay nhap vao mot so nguyen: '); readln(n);
for i:= 1 to n do
s:= s + (1/(i*(i+1));
writeln(' tong s = ',s:0:2);
readln
end.
var i,n:integer;
s:real;
begin
s:=1;
write('ban hay nhap vao mot so nguyen: '); readln(n);
for i:= 1 to n do
s:= s + (1/(i*(i+1));
writeln(' tong s = ',s:0:2);
readln
end.
\(B=\dfrac{2}{1\cdot2\cdot3}+\dfrac{2}{2\cdot3\cdot4}+\dfrac{2}{3\cdot4\cdot5}+\dfrac{2}{4\cdot5\cdot6}+\dfrac{2}{5\cdot6\cdot7}+\dfrac{2}{6\cdot7\cdot8}\)
\(B=\dfrac{2}{1.2.3}+\dfrac{2}{2.3.4}+\dfrac{2}{3.4.5}+\dfrac{2}{4.5.6}+\dfrac{2}{5.6.7}+\dfrac{2}{6.7.8}\)
\(=\dfrac{1}{1.2}-\dfrac{1}{2.3}+\dfrac{1}{2.3}-\dfrac{1}{3.4}+...+\dfrac{1}{6.7}-\dfrac{1}{7.8}\)
\(=\dfrac{1}{1.2}-\dfrac{1}{7.8}\)
\(=\dfrac{1}{2}-\dfrac{1}{56}=\dfrac{27}{56}\)
Tính tổng: \(B=\dfrac{1}{1\cdot2\cdot3}+\dfrac{1}{2\cdot3\cdot4}+\dfrac{1}{3\cdot4\cdot5}+...+\dfrac{1}{n\left(n+1\right)\left(n+2\right)}\)
Làm theo hướng dẫn: \(\dfrac{1}{k\left(k+1\right)\left(k+2\right)}=\dfrac{1}{2}\left(\dfrac{1}{k}+\dfrac{1}{k+2}\right)-\dfrac{1}{k+1}\)
Lời giải:
Ta có: \(\frac{1}{k(k+1)(k+2)}=\frac{1}{2}.\frac{2}{k(k+1)(k+2)}=\frac{1}{2}.\frac{(k+2)-k}{k(k+1)(k+2)}\)
\(=\frac{1}{2}\left(\frac{k+2}{k(k+1)(k+2)}-\frac{k}{k(k+1)(k+2)}\right)=\frac{1}{2}\left(\frac{1}{k(k+1)}-\frac{1}{(k+1)(k+2)}\right)\)
Áp dụng vào bài toán:
\(\frac{1}{1.2.3}=\frac{1}{2}\left(\frac{1}{1.2}-\frac{1}{2.3}\right)\)
\(\frac{1}{2.3.4}=\frac{1}{2}\left(\frac{1}{2.3}-\frac{1}{3.4}\right)\)
\(\frac{1}{3.4.5}=\frac{1}{2}\left(\frac{1}{3.4}-\frac{1}{4.5}\right)\)
.......
\(\frac{1}{n(n+1)(n+2)}=\frac{1}{2}\left(\frac{1}{n(n+1)}-\frac{1}{(n+1)(n+2)}\right)\)
\(\Rightarrow B=\frac{1}{2}\left(\frac{1}{1.2}-\frac{1}{2.3}+\frac{1}{2.3}-\frac{1}{3.4}+\frac{1}{3.4}-\frac{1}{4.5}+...+\frac{1}{n(n+1)}-\frac{1}{(n+1)(n+2)}\right)\)
\(=\frac{1}{2}\left(\frac{1}{1.2}-\frac{1}{(n+1)(n+2)}\right)=\frac{1}{4}-\frac{1}{2(n+1)(n+2)}\)
Tính tổng:
\(B=\dfrac{1}{1\cdot2\cdot3}+\dfrac{1}{2\cdot3\cdot4}+\dfrac{1}{3\cdot4\cdot5}+...+\dfrac{1}{n\left(n+1\right)\left(n+2\right)}\)
Làm theo hướng dẫn: \(\dfrac{1}{k\left(k+1\right)\left(k+2\right)}=\dfrac{1}{2}\left(\dfrac{1}{k}+\dfrac{1}{k+2}\right)-\dfrac{1}{k+1}\)
\(B=\dfrac{1}{2}\left(\dfrac{2}{1\cdot2\cdot3}+\dfrac{2}{2\cdot3\cdot4}+...+\dfrac{2}{n\left(n+1\right)\left(n+2\right)}\right)\)
\(=\dfrac{1}{2}\left(\dfrac{1}{1\cdot2}-\dfrac{1}{2\cdot3}+\dfrac{1}{2\cdot3}-\dfrac{1}{3\cdot4}+...+\dfrac{1}{n\cdot\left(n+1\right)}-\dfrac{1}{\left(n+1\right)\left(n+2\right)}\right)\)
\(=\dfrac{1}{2}\left(\dfrac{1}{2}-\dfrac{1}{\left(n+1\right)\left(n+2\right)}\right)\)
\(=\dfrac{1}{2}\cdot\dfrac{n^2+3n+2-2}{2\left(n+1\right)\left(n+2\right)}=\dfrac{n\left(n+3\right)}{4\left(n+1\right)\left(n+2\right)}\)
Tính giá trị biểu thức :
1. \(A=\dfrac{\dfrac{2}{5}+\dfrac{2}{7}-\dfrac{2}{9}-\dfrac{2}{11}}{\dfrac{4}{5}+\dfrac{4}{7}-\dfrac{4}{9}-\dfrac{4}{11}}\)
2. \(B=\dfrac{1^2}{1\cdot2}\cdot\dfrac{2^2}{2\cdot3}\cdot\dfrac{3^2}{3\cdot4}\cdot\dfrac{4^2}{4\cdot5}\)
3. \(C=\dfrac{2^2}{1\cdot3}\cdot\dfrac{3^2}{2\cdot4}\cdot\dfrac{4^2}{3\cdot5}\cdot\dfrac{5^2}{4\cdot6}\cdot\dfrac{5^2}{4\cdot6}\)
4. \(D=\left(\dfrac{4}{5}-\dfrac{1}{6}\right)\cdot\left(\dfrac{2}{3}\cdot\dfrac{1}{4}\right)^2\)
5. Cho \(M=8\dfrac{2}{7}-\left(3\dfrac{4}{9}+4\dfrac{2}{7}\right)\) ; \(N=\left(10\dfrac{2}{9}+2\dfrac{3}{5}\right)-6\dfrac{2}{9}\). Tính \(P=M-N\)
6. \(E=10101\left(\dfrac{5}{111111}+\dfrac{5}{222222}-\dfrac{4}{3\cdot7\cdot11\cdot13\cdot37}\right)\)
7. \(F=\dfrac{\dfrac{1}{3}+\dfrac{1}{7}-\dfrac{1}{13}}{\dfrac{2}{3}+\dfrac{2}{7}-\dfrac{2}{13}}\cdot\dfrac{\dfrac{3}{4}-\dfrac{3}{16}-\dfrac{3}{256}+\dfrac{3}{64}}{1-\dfrac{1}{4}+\dfrac{1}{16}-\dfrac{1}{64}}+\dfrac{5}{8}\)
8. \(G=\text{[}\dfrac{\left(6-4\dfrac{1}{2}\right):0,03}{\left(3\dfrac{1}{20}-2,65\right)\cdot4+\dfrac{2}{5}}-\dfrac{\left(0,3-\dfrac{3}{20}\right)\cdot1\dfrac{1}{2}}{\left(1,88+2\dfrac{3}{25}\right)\cdot\dfrac{1}{80}}\text{]}:\dfrac{49}{60}\)
9. \(H=\dfrac{1}{1\cdot2\cdot3}+\dfrac{1}{2\cdot3\cdot4}+\dfrac{1}{4\cdot5\cdot6}+...+\dfrac{1}{98\cdot99\cdot100}\)
10. \(I=\dfrac{8}{9}\cdot\dfrac{15}{16}\cdot\dfrac{24}{25}\cdot...\cdot\dfrac{2499}{2500}\)
11. \(K=\left(-1\dfrac{1}{2}\right)\left(-1\dfrac{1}{3}\right)\left(-1\dfrac{1}{4}\right)...\left(-1\dfrac{1}{999}\right)\)
12. \(L=1\dfrac{1}{3}+1\dfrac{1}{8}+1\dfrac{1}{15}...\) (98 thừa số)
13. \(M=-2+\dfrac{1}{-2+\dfrac{1}{-2+\dfrac{1}{-2+\dfrac{1}{3}}}}\)
14. \(N=\dfrac{155-\dfrac{10}{7}-\dfrac{5}{11}+\dfrac{5}{23}}{403-\dfrac{26}{7}-\dfrac{13}{11}+\dfrac{13}{23}}\)
15. \(P=\left(\dfrac{1}{4}-1\right)\left(\dfrac{1}{5}-1\right)...\left(\dfrac{1}{2001}-1\right)\)
16. \(Q=\left(\dfrac{1}{1\cdot2}+\dfrac{1}{3\cdot4}+\dfrac{1}{4\cdot5}+...+\dfrac{1}{2005\cdot2006}\right):\left(\dfrac{1}{1004\cdot2006}+\dfrac{1}{1005\cdot2005}+...+\dfrac{1}{2006\cdot1004}\right)\)
1. \(A=\dfrac{2\left(\dfrac{1}{5}+\dfrac{1}{7}-\dfrac{1}{9}-\dfrac{1}{11}\right)}{4\left(\dfrac{1}{5}+\dfrac{1}{7}-\dfrac{1}{9}-\dfrac{1}{11}\right)}=\dfrac{2}{4}=\dfrac{1}{2}\)
2. \(B=\dfrac{1^2.2^2.3^2.4^2}{1.2^2.3^2.4^2.5}=\dfrac{1}{5}\)
3.\(C=\dfrac{2^2.3^2.\text{4^2.5^2}.5^2}{1.2^2.3^2.4^2.5.6^2}=\dfrac{125}{36}\)
4.D=\(D=\left(\dfrac{4}{5}-\dfrac{1}{6}\right).\dfrac{4}{9}.\dfrac{1}{16}=\dfrac{19}{30}.\dfrac{1}{36}=\dfrac{19}{1080}\)
Tính:
a) \(A=1+\dfrac{1}{2}\left(1+2\right)+\dfrac{1}{3}\left(1+2+3\right)+\dfrac{1}{4}\left(1+2+3+4\right)+...+\dfrac{1}{2013}\left(1+2+...+2013\right)\)b) \(B=\dfrac{1-3}{1\cdot3}+\dfrac{2-4}{2\cdot4}+\dfrac{3-5}{3\cdot5}+\dfrac{4-6}{4\cdot6}+...+\dfrac{2011-2013}{2011\cdot2013}+\dfrac{2012-2014}{2012\cdot2014}+\dfrac{2013-2015}{2013\cdot2015}\)Giúp mình với!
\(A=1+\dfrac{\dfrac{\left(1+2\right).2}{2}}{2}+\dfrac{\dfrac{\left(1+3\right).3}{2}}{3}+...+\dfrac{\dfrac{\left(1+2013\right).2013}{2}}{2013}\)
\(A=1+\dfrac{\dfrac{3.2}{2}}{2}+\dfrac{\dfrac{4.3}{2}}{3}+...+\dfrac{\dfrac{2014.2013}{2}}{2013}\)
\(A=1+\dfrac{3}{2}+\dfrac{2.3}{3}+...+\dfrac{1007.2013}{2013}\)
\(A=1+\dfrac{3}{2}+2+\dfrac{5}{2}...+1007\)
\(2A=2+3+4+5+6+...+2012+2013+2014\)
\(2A=\dfrac{\left(2+2014\right).2013}{2}\)
\(A=\dfrac{2016.2013}{4}=504.2013\)
\(B=\dfrac{-2}{1.3}+\dfrac{-2}{2.4}+...+\dfrac{-2}{2012.2014}+\dfrac{-2}{2013.2015}\)
\(-B=\dfrac{2}{1.3}+\dfrac{2}{2.4}+...+\dfrac{2}{2012.2014}+\dfrac{2}{2013.2015}\)
\(-B=\left(\dfrac{2}{1.3}+\dfrac{2}{3.5}+...+\dfrac{2}{2013.2015}\right)+\left(\dfrac{2}{2.4}+\dfrac{2}{4.6}+...+\dfrac{2}{2012.2014}\right)\)
\(-B=\left(\dfrac{3-1}{1.3}+\dfrac{5-3}{3.5}+...+\dfrac{2015-2013}{2013.2015}\right)+\left(\dfrac{4-2}{2.4}+\dfrac{6-4}{4.6}+...+\dfrac{2014-2012}{2012.2014}\right)\)
\(-B=\left(1-\dfrac{1}{3}+\dfrac{1}{3}-\dfrac{1}{5}+\dfrac{1}{2013}-\dfrac{1}{2015}\right)+\left(\dfrac{1}{2}-\dfrac{1}{4}+\dfrac{1}{4}+...+\dfrac{1}{2012}-\dfrac{1}{2014}\right)\)
\(-B=\left(1-\dfrac{1}{2015}\right)+\left(\dfrac{1}{2}-\dfrac{1}{2014}\right)\)
\(-B=\dfrac{2014}{2015}+\dfrac{2012}{2014.2}=\dfrac{2014^2+1006.2015}{2015.2014}\)
\(B=\dfrac{2014^2+1006.2015}{-2015.2014}\)
tính tổng
S=\(\dfrac{1}{1\cdot2\cdot3}+\dfrac{1}{2\cdot3\cdot4}+\dfrac{1}{3\cdot4\cdot5}+...+\dfrac{1}{n\cdot\left(n+1\right)\cdot\left(n+2\right)}\)
A=1+\(\dfrac{1}{3}+\dfrac{1}{5}+\dfrac{1}{7}+...+\dfrac{1}{99}\)
B= \(\dfrac{1}{2}+\dfrac{1}{3}+\dfrac{1}{4}+...\dfrac{1}{100}\)
C=\(\dfrac{99}{1}+\dfrac{98}{2}+\dfrac{97}{3}+...+\dfrac{1}{99}\)
a) Ta có
S = \(\dfrac{1}{1.2.3}+\dfrac{1}{2.3.4}+\dfrac{1}{3.4.5}+...+\dfrac{1}{n.\left(n+1\right).\left(n+2\right)}\)
2S = \(\dfrac{2}{1.2.3}+\dfrac{2}{2.3.4}+\dfrac{2}{3.4.5}+...+\dfrac{2}{n.\left(n+1\right).\left(n+2\right)}\)
2S = \(\dfrac{1}{1.2}-\dfrac{1}{2.3}+\dfrac{1}{2.3}-\dfrac{1}{3.4}+\dfrac{1}{3.4}-\dfrac{1}{4.5}+...+\dfrac{1}{n\left(n+1\right)}-\dfrac{1}{\left(n+1\right).\left(n+2\right)}\)2S = \(\dfrac{1}{1.2}-\dfrac{1}{\left(n+1\right).\left(n+2\right)}\)
S = \(\dfrac{1}{4}-\dfrac{1}{\left(n+1\right).\left(n+2\right):2}\)
b) A = \(1+\dfrac{1}{3}+\dfrac{1}{5}+\dfrac{1}{7}+...+\dfrac{1}{99}\)
A = \(2-\dfrac{1}{3}+\dfrac{1}{3}-\dfrac{1}{5}+\dfrac{1}{5}-\dfrac{1}{7}+...+\dfrac{1}{97}-\dfrac{1}{99}\)
A = \(2-\dfrac{1}{99}\)
A = \(\dfrac{197}{99}\)
c) Ta có
B = \(\dfrac{1}{2}+\dfrac{1}{3}+\dfrac{1}{4}+...+\dfrac{1}{100}\)
B = \(1-\dfrac{1}{2}+\dfrac{1}{2}-\dfrac{1}{3}+\dfrac{1}{3}-\dfrac{1}{4}+...+\dfrac{1}{99}-\dfrac{1}{100}\)
B = \(1-\dfrac{1}{100}\)
B = \(\dfrac{99}{100}\)
d) Ta có
C = \(\dfrac{99}{1}+\dfrac{98}{2}+\dfrac{97}{3}+...+\dfrac{1}{99}\)
C = \(1+\left(1+\dfrac{98}{2}\right)+\left(1+\dfrac{97}{3}\right)+...+\left(1+\dfrac{1}{99}\right)\)
C = \(1+50+\dfrac{100}{3}+...+\dfrac{100}{99}\)
C = 51 + 100(\(\dfrac{1}{3}+\dfrac{1}{4}+\dfrac{1}{5}+...+\dfrac{1}{99}\))
Đặt D = \(\dfrac{1}{3}+\dfrac{1}{4}+\dfrac{1}{5}+...+\dfrac{1}{99}\)
D = \(\dfrac{1}{2}-\dfrac{1}{3}+\dfrac{1}{3}-\dfrac{1}{4}+\dfrac{1}{4}-\dfrac{1}{5}+...+\dfrac{1}{98}-\dfrac{1}{99}\)
D = \(\dfrac{1}{2}-\dfrac{1}{99}\)
D = \(\dfrac{97}{198}\)
=> C = 51 + 100.\(\dfrac{97}{198}\)
C = 51 + \(\dfrac{4850}{99}\)
C = \(\dfrac{9899}{99}\)
Đây là bài làm của mình sai thì nx nha