I was talking to my smart nephew the other day. He loves math and loves even more to stump me with math riddles and puzzles.
Me: Let’s talk about some fun problems with prime numbers*. I’m thinking of two prime numbers that add up to 753, what are they?
Nephew (instantly): Oh, come on, Uncle. That’s too easy. Clearly if the sum of two numbers is odd (in this case 753) then one of them must be even and the other odd. But the only even prime number is 2, so your numbers are 751 and 2.
Me: OK, you’re a genius.
Nephew: I have one for you. Think of prime numbers with a single digit repeated many times. The smallest such number is 11. What’s the next one?
Me: OK, Let’s see. A single digit repeated. A number like 777, hmm. Clearly the digit cannot be anything other than a 1 because if it’s any other digit like 7 the number will be divisible by 7 and hence not prime.
Me: So the prime will be composed of repeating 1′s. It’s not 111 because 111=37×3. It’s not 1111 because that can be divided by 11. What about 11,111? How do I check what the factors are for 11,111 or whether it’s a prime?
Nephew: You’re on the right track, my smart but oh-so-out-of-touch Uncle. Have you tried a great tool called Wolfram Alpha? It’s an Answer Engine as opposed to a mere search engine. It actually calculates your query using the famous computational program, Mathematica, written by scientist, Stephen Wolfram. Among other things it will factorize any number for you – within limits, of course. No one can factorize extremely large numbers, those containing say 100 digits, yet. But Wolfram Alpha will do any math that is possible, even including symbolic math and closed form equation solving, and will give you the latest conjectures to boot.
Try it and see if you can factorize 11,111.
So I pulled up my iPad, went to the site http://www.wolframalpha.com and typed in “factorize 11,111” as below:
Back came the answer:
It had factored my number: 11,111 = 41 × 271.
Me: You have shown me a great new resource, dear nephew. Now I shall try numbers with repeated 1′s to find a prime number.
Nephew: Great! And did you notice that you only need try numbers with 1′s repeated a prime number of times? So you needn’t try 1 repeated six times or 111,111 because 6 is composite. Since 6=3×2, you know 111,111 will be divisible by 11 or 111. Right?
Me: I was just going to say that myself. So the next numbers we will try will have repeating 1′s: 7, 11, 13, 17, 19, 23…. times. We tried them on the Wolfram Alpha Math Engine and got:
7: 1 111 111 = 239 × 4649
11: 11 111 111 111 = 21 649 × 513 239
13: 1 111 111 111 111 = 53 × 79 × 4187 × 265 371 653 × 14 064 697 609
17: 11 111 111 111 111 111 = 2 071 723 × 5 363 222 357
19: 1 111 111 111 111 111 111 = Prime!!!
Success! The smallest prime number with a repeating digit (after 11) is 1,111,111,111,111,111,111 or 1 repeated 19 times! We would never have been able to compute this using any conventional program like Excel or a traditional search!
Turns out the next one is 1 repeated 23 times and then we don’t see any more primes of this form for quite a while. They are there though. Many have been found but it’s a tough job even for very fast supercomputers.
Wolfram Alhpa is a real boon. Try it if you love playing with numbers or symbolic math. Here’s one last result I got playing with this fantastic math engine. I asked for the integral of secant(x). The answer, along with graphs, a Taylor’s series expansion and much more came out as below:
What a fun resource available to all math freaks!