Tính tổng:S = 1^2+2^2+3^2+....+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.
uses crt;
var i,n:longint;
s:real;
begin
clrscr;
write('Nhap n='); readln(n);
s:=0;
for i:=1 to n do
s:=s+sqr(i);
writeln(s:0:0);
readln;
end.
uses crt;
var n,i:longint;
s:real;
{------------ham-tinh-giai-thua---------------------}
function gthua(x:longint):real;
var i:longint;
gt:real;
begin
gt:=1;
for i:=1 to x do
gt:=gt*i;
gthua:=gt;
end;
{------------chuong-trinh-chinh------------------}
begin
clrscr;
write('Nhap n='); readln(n);
s:=0;
for i:=1 to n do
s:=s+gthua(i);
writeln(s:0:0);
readln;
end.
S=2+4+6+...+98+100
S=\(\frac{\left[\left(\frac{100-2}{2}+1\right).\left(100+2\right)\right]}{2}=2550\)
S=1+2+3+4+...+2016+2017
S=\(\frac{\left(2017-1+1\right).\left(2017+1\right)}{2}=2035153\)
1.Số lượng số của S= (2017-1)+1=2017 số
tổng=(2016+1).(2016:2)+2017=2 035 153
2.Số lượng số của S=(100-2):2+1=50 số
tổng=(100+2).(50:2)=2 550
\(S=1\cdot2+2\cdot3+3\cdot4+...+99\cdot100\\ 3S=1\cdot2\cdot3+2\cdot3\cdot3+3\cdot3\cdot4+...+3\cdot99\cdot100\\ 3S=1\cdot2\cdot3+2\cdot3\cdot\left(4-1\right)+3\cdot4\cdot\left(5-2\right)+...+99\cdot100\cdot\left(101-98\right)\\ 3S=1\cdot2\cdot3+2\cdot3\cdot4-1\cdot2\cdot3+....+99\cdot100\cdot101-98\cdot99\cdot100\\ 3S=99\cdot100\cdot101\\ S=\dfrac{99\cdot100\cdot101}{3}=33\cdot100\cdot101=3300\cdot101=333300\)
Ta có: S=22+42+62+...+202
=(2.1)2+(2.2)2+(2.3)2+...+(2.10)2
=22.12+22.22+22.32+...+22.102
=22.(1+22+32+...+102)
Mà 12+22+32+...+102=385 nên:
S=22.385
=4.385
=1540
Vậy S=1540
S=(1+2)+(2^2+2^3)+(2^4+2^5)+....+(2^99+2^100)
S=3+3.2^2+3.2^4+.....+3.2^99
S=3.(2^2+2^4+.....+2^99)
Vì 3 chia hết 3=>3.(2^2+2^4+....+2^99)
=>S chia hết 3
2S=2+2^2+2^3+2^4+.....+2^101
2S-S=(2+2^2+2^3+2^4+....+2^101)-(1+2+2^2+2^3+2^4+....+2^100)
S=2^101-1
S+1=2^101-1+1=2^101
=>x=101
\(S=3+\frac{3}{2}+\frac{3}{2^2}+....+\frac{3}{2^9}\)
\(S\cdot\frac{1}{3}=1+\frac{1}{2}+\frac{1}{2^2}+...+\frac{1}{2^9}\)
\(S\cdot\frac{2}{3}=2+1+\frac{1}{2}+...+\frac{1}{2^8}\)
\(S\cdot\frac{2}{3}-S\cdot\frac{1}{3}=2+1+\frac{1}{2}+...+\frac{1}{2^8}-1-\frac{1}{2}-...-\frac{1}{2^9}\)
\(S\cdot\frac{1}{3}=2-\frac{1}{2^9}\)
\(S=\left(2-\frac{1}{2^9}\right):\frac{1}{3}\)
\(S=\left(2-\frac{1}{2^9}\right)\cdot3\)
\(S=6-\frac{3}{2^9}\)
\(S=\frac{6\cdot2^9-3}{2^9}\)
\(S=1^2+2^2+3^2+...+n^2\)
\(=1.2-1+2.3-2+3.4-3+...+n\left(n+1\right)-n\)
\(=\left[1.2+2.3+3.4+...+n\left(n+1\right)\right]-\left(1+2+3+...+n\right)\)
Theo dạng tổng quát: \(1.2+2.3+3.4+...+n\left(n+1\right)=\frac{n\left(n+1\right)\left(n+2\right)}{3}\)
\(\Rightarrow S=\frac{n\left(n+1\right)\left(n+2\right)}{3}-\frac{n\left(n+1\right)}{2}\)
\(=\frac{2n\left(n+1\right)\left(n+2\right)}{6}-\frac{3n\left(n+1\right)}{6}\)
\(=\frac{2n\left(n+1\right)\left(n+2\right)-3n\left(n+1\right)}{6}\)
\(=\frac{n\left(n+1\right).\left[2\left(n+2\right)-3\right]}{6}=\frac{n\left(n+1\right)\left(2n+1\right)}{6}\)
Vậy \(S=\frac{n\left(n+1\right)\left(2n+1\right)}{6}\)
Ta có : \(S=1^2+2^2+3^2+...+\)\(n^2\)
\(\Rightarrow S=\frac{n.\left(n+1\right)\left(n+2\right)}{2}\)