Can we devise a formula for a series like this,
S=n+7(n-1+7(n-2+7(n-3+.........)))
when n=1 S=1 first three terms are 1,9,66 someone says it has a formula but i cant find any help!!!
# | User | Rating |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 161 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | luogu_official | 150 |
Name |
---|
https://www.wolframalpha.com/input/?i=sum(7%5Ei+*+(n+-+i)+for+i+%3D+0...n)
S(n + 1) = n + 1 + 7·S(n)
Now this can be solved by standart methods.
I can offer to read about generating function (Link). In short:
S(0) = 0
S(n) = n + 7*S(n — 1)
Multiply first line by x^0, ans second by x^n and sum all lines. Assume S(0)*x^0 + S(1)*x^1+.... = G(x):
G(x) = 7xG(x) + (1 * x^1 + 2 * x^2 + 3 * x^3 + ....)
Expression in brackets can be simplify to x/(1-x)^2. So we can find formula:
G(x) = x/((1-x)^2*(1-7x)) = (7/(1 — 7x) — 1/(1 — x) — 6/(1-x)^2)/36. And we can expand all fractions:
1/(1 — ax) = (ax)^0 + (ax)^1 + ...;
1/(1 — x)^2 = (1 * x^0 + 2 * x^1 + 3 * x^2 + ...);
Calculate all coeffs in left part and all coeffs in right part. And we get finally formula:
S(n) = (7^(n + 1) — 7 — 6n)/36. Check formula for first n:
S(0) = 0;
S(1) = 1;
S(2) = 9;
S(3) = 66;
Thank you very much that helped a lot.........