为什么用公式计算没有出现数据出现零怎么回事?

用下面这个公式计算零点效率非常高:\begin{align} \frac{1}{1-2^{1-s}} \sum_{n=0}^{\infty } \left (
\frac{1}{2^{n+1}} \sum_{k=0}^{n} \frac {\left ( -1 \right ) ^{k}} {\left ( k+1 \right )^{s} } \binom{n}{k} \right ) \end{align} 比 \begin{align}\frac{1}{1-\frac{2}{2^{s}} } \sum_{n=0}^{\infty }\frac{ \left( -1 \right ) ^{n-1}}{n^{s}}\end{align} 要快很多。python代码:def zeta(s):
E = 1e-10
res = 0+0j
n = -1
while True:#first sigma
n += 1
kk = 0+0j
comb = 1
for k in range(n+1):#second sigma
kk += comb * (k+1) ** -s
comb *= (k-n) / (k+1)
kk *= 2 ** - (n+1)
res += kk
if abs(kk) < E:
# print(n)
break
return res / (1 - 2 ** (1-s))
print(zeta(0.5+1j*14.13472514173500016454))}
一路同行共同好孕母婴孕育全面覆盖免费咨询有问必答扫码申请入群微信扫一扫直接添加生殖顾问${weixinhao}
`
].join("");
var urls = window.location.href;
var ua = window.navigator.userAgent.toLowerCase();
document.writeln(PChtmlCodes);
function open_model(a,b) {
document.getElementById("reproduction").style.display = "block";
try {
_hmt.push(['_trackEvent', a, b, urls]);
console.log('添加成功')
} catch (error) {
console.log('添加失败')
}
}
function close_model() {
document.getElementById("reproduction").style.display = "none";
}
function copyswxh(a,b) {
if (navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)) {
const range = document.createRange();
range.selectNode(document.getElementById("wxh_copys"));
const selection =
window.getSelection();
if(selection.rangeCount > 0) getSelection().removeAllRanges();
selection.addRange(range);
document.execCommand('copy');
alert(`微信:${weixinhao}复制成功,请打开微信添加`)
window.location.href = 'weixin://';
try {
_hmt.push(['_trackEvent', a, b, urls]);
console.log('添加成功')
} catch (error) {
console.log('添加失败')
}
}else{
var input = document.createElement("input");
input.setAttribute("readonly","readonly");
input.setAttribute("value",`${weixinhao}`);
document.body.appendChild(input);
input.setSelectionRange(0,999);
input.select();
if(document.execCommand('copy')){
document.execCommand('copy');
alert(`微信:${weixinhao}复制成功,请打开微信添加`)
window.location.href = 'weixin://';
}
document.body.removeChild(input);
try {
_hmt.push(['_trackEvent', a, b, urls]);
console.log('添加成功')
} catch (error) {
console.log('添加失败')
}
}
}
}

我要回帖

更多关于 段数和次数的公式 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信