Hacker News new | ask | show | jobs
by cnvogel 3082 days ago
Quote from the Article: """The figure is calculated by multiplying 2 by itself 77,232,917 times and then subtracting 1."""

Would HN agree that multiplying 2 by itself once is 2⨯2 = pow(2,2), twice is 2⨯2⨯2 = pow(2,3) and N times yields pow(2,N+1)?

The Mersenne Prime found is pow(2,77232917) − 1, hence the article got the number wrong?

2 comments

If you're going that way, you can also interpret it - pardon my programming - as the following:

  int result; 
  for (int i = 0; i < 77232917; i++) { 
      result = 2 * 2; 
  } 
  return result - 1; 
... which obviously results in 3. Also a (mersienne) prime, but not quite as big as you'd expect, and certainly not millions of digits long.

  int result; 
  for (int i = 0; i < 77232917; i++) { 
      result = 2 * 2; <----- you basically said result=4 77232917 times 
  } 
  return result - 1; <--- and then 4-1=3
so of course it will always be 3
That is the joke.
Yeah, I suppose if one wants to be pedantic. But we know what it means.
Dang ol' off-by-one errors.