There was once a recruitment campaign by Google which involved putting this mysterious message on billboards:
{ first 10 digit prime in consecutive digits of e } . com
which many people solved and it lead them to a website and down a rabbit hole further testing their abilities. I had a go at this question myself and did manage to find the answer, but I didn’t record the method I used. It definitely involved a long command I typed into a terminal window, but I have a feeling I “cheated” by using a semi-colon. What I mean is, my solution wasn’t technically a “one-liner”, and was therefore no more interesting than a solution written in any other language. While emailing a friend of mine recently, this puzzle came to mind, and I decided that I would see if I could write a one-line BASH script to generate the answer. I did manage to, but it’s a little bit scary, so I’ll share it with you and try to explain it in this blog post.
Continue reading "first 10 digit prime in consecutive digits of e"