这有什么重要意义? (或者你在哪里看到这个)? 2^n-1
我知道这可能是一个模糊的问题(或不是!)。
我在某个地方见过这个 2^n-1 (或 2^n+1)。你在哪里看到这个等式?为什么它很重要?什么时候使用它?
I know this could be a vague question (or not!).
I've seen this somewhere 2^n-1 (or 2^n+1). Where do you see this equation? and why is it significant? And when do you use it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
2^n-1 是 n 位的最高无符号整数。
这也是一个容易测试素数的数字,梅森素数 http://en.wikipedia.org/wiki/Mersenne_prime< /a>
这也是我行李箱上的组合。
问题的重点是什么?
2^n-1 is the highest unsigned integer of n bits.
It's also a number easily tested for primeness, Mersenne prime http://en.wikipedia.org/wiki/Mersenne_prime
It's also the combination on my suitcase.
What's the point question?
约翰·史密斯回答了它最常见的用法。 2^n-1 是可以用 n 位存储的最大无符号整数。
哦,还有 梅森素数 作为 Beemer指出(来自他的页面的链接)。
John Smith answered the most common use of it. 2^n-1 is the largest unsigned integer you can store with n bits.
Oh, and mersenne primes as Beemer pointed out (link from his page).
它也是高度为 n 的平衡二叉树中的最大节点数。
It's also the maximum number of nodes in a balanced binary tree of height n.