Note to recruiters

Note to recruiters: We are quite aware that recruiters, interviewers, VCs and other professionals generally perform a Google Search before they interview someone, take a pitch from someone, et cetera. Please keep in mind that not everything put on the Internet must align directly to one's future career and/or one's future product portfolio. Sometimes, people do put things on the Internet just because. Just because. It may be out of their personal interests, which may have nothing to do with their professional interests. Or it may be for some other reason. Recruiters seem to have this wrong-headed notion that if somebody is not signalling their interests in a certain area online, then that means that they are not interested in that area at all. It is worth pointing out that economics pretty much underlies the areas of marketing, strategy, operations and finance. And this blog is about economics. With metta, let us. by all means, be reflective about this whole business of business. Also, see our post on "The Multi-faceted Identity Problem".

Monday, September 10, 2012

The world's largest known prime - and a puzzle

Courtesy Fabrice Bellard, here is a compact computer program in C to print out the world's largest known prime.

int m=167772161,N=1,t[1<<25]={2},a,*p,i,e=34893349,s,c,U=1;g(d,h){for(i=s;i<1<<24;i*=2)d=d*1LL*d%m;for(p=t;p<t+N;p+=s)for(i=s,c=1;i;i--)a=p[s]*(h?c:1LL)%m,p[s]=(m+*p-a)*(h?1LL:c)%m,a+=*p,*p++=a%m,c=c*1LL*d%m;}main(){while(e/=2){N*=2;U=U*1LL*(m+1)/2%m;for(s=N;s/=2;)g(17,0);for(p=t;p<t+N;p++)*p=*p*1LL**p%m*U%m;for(s=1;s<N;s*=2)g(29606852,1);for(a=0,p=t;p<t+N;)a+=*p<<(e&1),*p++=a%10,a/=10;}while(!*--p);for(t[0]--;p>=t;)putchar(48+*p--);}

The program is just 438 characters in length. It compiles quite quickly on the MacBook Pro and requires less than 5 minutes of running time.

This number, the largest known prime, belongs to a class of primes called Mersenne primes and has the value  243112609-1. It has no less than 13 million digits. I ran the program earlier today, and have pasted the first ten lines or so of the output below. I have a little mnemonic scheme to remember long strings of numbers and so I created a mnemonic to remember the first ten digits of the number. And so if you ever wanted to commit to memory the digits of the world's largest prime, you can start right here :


And so that brings me to the puzzle for this month. What is the last digit of the above prime number? It is not a very difficult puzzle, but it might take some thinking.

And so, enjoy your day. And happy solving!