![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWf_xsgvK1ouS5KvVsiC2532VgbmXNUeXOBtzAuwKxLIRtTCc-XFkH3hImIzPaS_4h4B5YCguVWFclw-VkJFjP0refjxhcQE3WQmSGEnbzjSb1vbzGzM6NmCPWTDTJjqkMOVmkMo88svSl/s200/PrimeTime.jpg)
Taking a walk down Geek Lane this week with a look at exploring Prime Numbers in Excel. Specifically, Mersenne Prime Numbers. A Mersenne Number is a number in the form of Mn=(2^n)-1. Although Excel is not robust enough to explore this in depth, it is nonetheless interesting to see what can be done.
So, assuming you have a bit of geek in you, here is what you can do.
1. Create a simple spreadsheet with a similar format to the following starting in A1:
2. Starting in A3, insert consecutive numbers starting with 2 into Column A.
3. In B3, place the formula, “=(2^A3)-1”and copy down with relative references
4. Go to the Blue Moose Technology site (Thanks, Blue Moose!) and copy the prime code into a new module in your workbook
5. Finally, use the resulting “ISPRIME” custom function starting in C3 to determine if the numbers in the B column are prime
Obviously, this exercise is not of interest to everyone, but if you find both Excel and Prime Numbers exciting, give it a try. You might find you are “Ready for Prime Time”.
So, assuming you have a bit of geek in you, here is what you can do.
1. Create a simple spreadsheet with a similar format to the following starting in A1:
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhk09HyurB8-Vun9a6Yg04GdEJcyvrnlIcHaQ-mgxevuj1Kb2TSevcZPBrCvvii2xXSqhjjn93RNz7JKQox3QWjkPNQy1T8kwsjxgvpcUUVw7MMY2b-ixK_HOC0Lh8gP-G0oM25ETEgPfdE/s200/Mersenne+Prime.jpg)
3. In B3, place the formula, “=(2^A3)-1”and copy down with relative references
4. Go to the Blue Moose Technology site (Thanks, Blue Moose!) and copy the prime code into a new module in your workbook
5. Finally, use the resulting “ISPRIME” custom function starting in C3 to determine if the numbers in the B column are prime
Obviously, this exercise is not of interest to everyone, but if you find both Excel and Prime Numbers exciting, give it a try. You might find you are “Ready for Prime Time”.
No comments:
Post a Comment