1.伯努利数能干啥
伯努利数求自然幂和
∑ i = 1 n i k = 1 k + 1 ∑ i = 1 k + 1 ( k + 1 i ) B k + 1 − i ( n + 1 ) i \sum_{i=1}^{n} i^k = \frac{1}{k+1}\sum_{i=1}^{k+1}\binom{k+1}{i}B_{k+1-i}(n+1)^i i=1∑nik=k+11i=1∑k+1(ik+1)Bk+1−i(n+1)i
2.怎么得到啊
1. O ( k 2 ) O(k^2) O(k2) 递推
B 0 = 1 B_0 = 1 B0=1
∑ k = 0 n ( n + 1 k ) B k = 0 \sum_{k=0}^{n}\binom{n+1}{k}B_k = 0 k=0∑n(kn+1)Bk=0
B n = − 1 n + 1 ∑ i = 0 n − 1 ( n + 1 i ) B i B_n = -\frac{1}{n+1} \sum_{i=0}^{n-1} \binom{n+1}{i}B_i Bn=−n+11i=0∑n−1(in+1)Bi
题目: 51nod 序列求和V2
code:
#include <iostream>
#include <cstring>
#include <string>
#include <algorithm>
#include <cstdio>
using namespace std;
typedef long long ll;
const int maxn = 1e5+10;