What's significant about this? (or where do you see this) ? 2^n-1

。_饼干妹妹 提交于 2020-01-25 02:47:25

问题


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?


回答1:


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:


How about this? http://primes.utm.edu/notes/proofs/Theorem2.html




回答3:


John Smith answered the most common use of it. 2^n-1 is the largest unsigned integer you can store with n bits.

  • 8 bits: 255
  • 16 bits: 65535
  • 32 bits: 4294967295

Oh, and mersenne primes as Beemer pointed out (link from his page).




回答4:


It's also the maximum number of nodes in a balanced binary tree of height n.



来源:https://stackoverflow.com/questions/4130165/whats-significant-about-this-or-where-do-you-see-this-2n-1

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!