tính tổng S với n thuộc số nguyên dương
S=1+2+5+14+..........+\(\dfrac{3^{n-1}+1}{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.
Đặt P=31-1+32-1+33-1+34-1+...+3n-1
=>P=30+31+32+33+...+3n-1
=>3.P=31+32+33+34+...+3n
=>3.P-P=31+32+33+34+...+3n-30-31-32-33-...-3n-1
=>2.P=3n-30
=>2.P=3n-1
=>\(P=\frac{3^n-1}{2}\)
Lại có: S=1+2+5+14+...+\(\frac{3^{n-1}+1}{2}\)
=>\(S=\frac{3^{1-1}+1}{2}+\frac{3^{2-1}+1}{2}+\frac{3^{3-1}+1}{2}+\frac{3^{4-1}+1}{2}+...+\frac{3^{n-1}+1}{2}\)
=>\(S=\frac{3^{1-1}+1+3^{2-1}+1+3^{3-1}+1+3^{4-1}+1+...+3^{n-1}+1}{2}\)
=>\(S=\frac{\left(3^{1-1}+3^{2-1}+3^{3-1}+3^{4-1}+...+3^{n-1}\right)+\left(1+1+1+1+...+1\right)}{2}\)
=>\(S=\frac{P+1.n}{2}\)
=>\(S=\frac{\frac{3^n-1}{2}+n}{2}\)
=>\(S=\frac{\frac{3^n-1}{2}+\frac{2n}{2}}{2}\)
=>\(S=\frac{\frac{3^n-1+2n}{2}}{2}\)
=>\(S=\frac{3^n-1+2n}{4}\)
nhìn cái cuối là biết quy luật đó bạn :))
\(S=\frac{3^{1-1}+1}{2}+\frac{3^{2-1}+1}{2}+\frac{3^{3-1}+1}{2}+...+\frac{3^{n-1}+1}{2}\)
\(S=\frac{\left(3^0+3^1+....+3^{n-1}\right)+\left(1+1+1+...+1\right)}{2}\left(\text{ có n c/s 1}\right)\)
\(S=\frac{\frac{\left(3^n-1\right)}{2}+n}{2}=3^n-1+\frac{n}{2}\)
chỗ 30+31+...+3n-1 bn tự tính :))
#include <bits/stdc++.h>
using namespace std;
double s,a;
int i,n;
int main()
{
cin>>a;
s=0;
n=0;
while (s<=a)
{
n=n+1;
s=s+1/(n*1.0);
}
cout<<n;
return 0;
}
Bài 1:
uses crt;
var n,i:integer;
s:real;
begin
clrscr;
write('Nhap n='); readln(n);
s:=0;
for i:=1 to n do
s:=s+1/(2*i+1);
writeln(s:4:2);
readln;
end.
1:
uses crt;
var n,i,t:integer;
begin
clrscr;
readln(n);
t:=0;
for i:=1 to n do
t:=t+i*i;
write(t);
readln;
end.
2
program bt2;
var i,n,t:integer;
begin
readln(n);
s:=0;
for i:=1 to n do
if i mod 2 = 1 then s:=s+i;
readln;
end.
\(S=1+2+5+14+...+\dfrac{3^{n-1}+1}{2};\left(n\in N\backslash\left\{0\right\}\right)\)
\(2S=2+4+10+28+....+\left(3^{n-1}+1\right)=S_1\)
\(2S=\left[1+1+....+n\right]+\left[1+3+9+..+3^{n-1}\right]\)
\(S_1=1+1+1+..+n=n\)
\(S_2=1+3+9+....+3^{n-1}\)
\(3S_2=3+9+...+3^n\)
\(3S_2-S_2=2S_2=3^n-1\Rightarrow S_2=\dfrac{3^n-1}{2}\)
\(S=\dfrac{s_1+s_2}{2}=\dfrac{n+\dfrac{3^n-1}{2}}{2}=\dfrac{3^n+2n-1}{4}\)