Viết chương trình tính tổng dãy số:
S= \(1+\frac{1}{2^2}\)+\(\frac{1}{3^2}\)+...+\(\frac{1}{100^2}\)
S= \(1+\frac{1}{3^2}\)+\(\frac{1}{5^2}\)+...+\(\frac{1}{N^2}\)
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.
b)
program hotrotinhoc;
var s: real;
i,n: byte;
function t(x: byte): longint;
var j: byte;
t1: longint;
begin
t1:=1;
for j:=1 to x do
t1:=t1*j;
t1:=t;
end;
begin
readln(n);
s:=0;
for i:=1 to n do
s:=s+1/t(i);
write(s:1:2);
readln
end.
c) Đề em ghi sai rồi thế này với đúng :
\(T=1+\frac{2}{2^2}+\frac{3}{3^2}+\frac{4}{4^2}+...+\frac{n}{n^2}\)
program hotrotinhoc;
var t: real;
n,i: byte;
begin
readln(n);
t:=0;
for i:=1 to n do
t:=t+i/(i*i);
write(t:1:2);
readln
end.
Với a , b , c là số hữu tỉ t/m a = b + c ta luôn có \(\sqrt{\frac{1}{a^2}+\frac{1}{b^2}+\frac{1}{c^2}}=\left|\frac{1}{a}-\frac{1}{b}-\frac{1}{c}\right|\)
Thật vậy : \(\sqrt{\frac{1}{a^2}+\frac{1}{b^2}+\frac{1}{c^2}}=\sqrt{\left(\frac{1}{a}-\frac{1}{b}-\frac{1}{c}\right)^2-2\left(\frac{1}{bc}-\frac{1}{ac}-\frac{1}{ab}\right)}\)
\(=\sqrt{\left(\frac{1}{a}-\frac{1}{b}-\frac{1}{c}\right)^2-\frac{2.abc\left(a-b-c\right)}{a^2b^2c^2}}\)(quy đồng lên )
\(=\sqrt{\left(\frac{1}{a}-\frac{1}{b}-\frac{1}{c}\right)^2}\left(\text{do a-b-c=0}\right)\)
\(=\left|\frac{1}{a}-\frac{1}{b}-\frac{1}{c}\right|\)
Áp dụng ta được \(S=\left|\frac{1}{2}-\frac{1}{1}-1\right|+\left|\frac{1}{3}-\frac{1}{2}-1\right|+...+\left|\frac{1}{100}-\frac{1}{99}-1\right|\)
\(=1+1-\frac{1}{2}+1+\frac{1}{2}-\frac{1}{3}+...+1+\frac{1}{99}-\frac{1}{100}\)
\(=\left(1+1+1+...+1\right)+\left(1+\frac{1}{2}+...+\frac{1}{99}\right)-\left(\frac{1}{2}+\frac{1}{3}+\frac{1}{100}\right)\)
(có 99 số 1)
\(=99+1-\frac{1}{100}\)
\(=100-\frac{1}{100}=\frac{9999}{100}\)
program chia;
uses crt;
var n,i:integer;
s:real;
begin
clrscr;
s:=0;
for i:=2 to 50 do s:=s+1/i;
writeln('Tong la ',s:1:2);
readln;
end.
\(S=1+\frac{1}{2}+\frac{1}{2^2}+\frac{1}{2^3}+...+\frac{1}{100}\)
\(\Rightarrow2S=2+1+\frac{1}{2}+\frac{1}{2^2}...+\frac{1}{99}\)
\(2S-S=\left(2+1+\frac{1}{2}+\frac{1}{2^2}+...+\frac{1}{2^{99}}\right)-\left(1+\frac{1}{2}+\frac{1}{2^2}+...+\frac{1}{2^{100}}\right)\)
\(\Leftrightarrow2S-S=S=2-\frac{1}{2^{100}}=\frac{2^{101}}{2^{100}}-\frac{1}{2^{100}}=\frac{2^{101}-1}{2^{100}}\)
\(1,-\frac{3}{29}+\frac{-7}{29}\le\frac{x}{29}\le-\frac{3}{29}-\frac{5}{29}\)
\(\Rightarrow-\frac{10}{29}\le\frac{x}{29}\le-\frac{8}{29}\Rightarrow-10\le x\le-8\)
\(\Rightarrow x=\left\{-8;-9;-10\right\}\)
\(S=\frac{1}{2}+\frac{1}{2^2}+\frac{1}{2^3}+\frac{1}{2^4}+...+\frac{1}{2^{99}}+\frac{1}{2^{100}}\)
\(\Rightarrow2S=1+\frac{1}{2}+\frac{1}{2^2}+\frac{1}{2^3}+...+\frac{1}{2^{99}}\)
\(S=\frac{1}{2}+\frac{1}{2^2}+\frac{1}{2^3}+\frac{1}{2^4}+...+\frac{1}{2^{99}}+\frac{1}{2^{100}}\)
\(\Rightarrow2S-S=S=1-\frac{1}{2^{100}}\)
Câu 2: Ta có \(S=6^2+18^2+30^2+...+126^2\)
\(S=6^2\left(1^2+3^2+5^2+...+21^2\right)\)
\(=6^2.1771=36.1771=63756\)
S = \(\frac{1}{2}+\frac{1}{2^2}+\frac{1}{2^3}+....+\frac{1}{2^{100}}\)
2S = \(1+\frac{1}{2}+\frac{1}{2^2}+...+\frac{1}{2^{99}}\)
2S - S = \(1-\frac{1}{2^{100}}\)
=> S = \(1-\frac{1}{2^{100}}\)
1: tính tổng của \(S=1+\frac{1}{2^2}+\frac{1}{3^2}+\frac{1}{4^2}+...+\frac{1}{100^2}\)
uses crt;
var s:real;
i:integer;
begin
clrscr;
s:=0;
for i:=1 to 100 do
s:=s+1/(sqr(i));
writeln('tong cua day so la: ',s);
readln;
end.
2: tính tổng \(S=1+\frac{1}{3^2}+\frac{1}{5^2}+\frac{1}{7^2}+...+\frac{1}{n^2}\)
uses crt;
var s:real;
n,i:integer;
begin
clrscr;
write('n='); readln(n);
s:=0;
for i:=1 to n do
if i mod 2=1 then s:=s+1/(sqr(i));
writeln('tong cua day so la: ',s:4:2);
readln;
end.