Prime Palindromes

Came across this on the “Programming Praxis” blog

I thought I’d use something other than a “typical” programming language, by which I mean not “an esoteric language”, but rather something that’s not thought of as a programming language: Mathematica.

This is the entirety of the solution, a one-liner that (using Timing), also shows how long it took.

The above is an image, but an online (read-only) notebook containing this evaluation is here at Wolfram Cloud.

Ten years ago, I’d be on the side of the fence saying “but that’s cheating“, or “hey, that’s not really programming“, but today my attitude is more of “use the right tool for the job“.

And Mathematica is a mighty fine tool !!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s