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".

Thursday, August 30, 2012

The world's largest prime


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 :

3164702693302559231434537239493375160541061884752646441403041767328112474930693686920431851216118378567268165399854650973561234326451796738535905772381793579008764261039437823764945917429345884971175871469169729847611590608732509394620855757407545770986205580117795298840421982876433193304650644552349881421395657854474740235463537585373248018381203876008684165254007903812858882566870858554562315775279393059208117665853086701321291552218043815486257879430206945280159992217181915577617890385395223497468087974769076640506012484732068741331946635853349838057348036207057782709105617167676809548144153100345024404451613323636117493261633464445423329417241203651488922044206753025635343930446888594451731619345493103361168211788553755310414238217064307960122462880374834762183969829160738164510589918315126863274884595850432467781607888733436616846762580064365828402220637577850480773894049127470626486721860033497517827818791204700203888737795893495898771199542833432881998869365937322503203399986100723393812928335949193182946075856105924454460588729823350956671321271750144252181252144132310783719856...

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!