Saturday, February 16, 2013

PS - what's a prime?

I apologize for my lack of discernment in the last post about what qualifies as general knowledge and what I know because I spent years studying mathematics.

So what are primes you ask (no, you're not the only one who was wondering)?

**In this post, for simplicity's sake, I use the term "number" to refer to positive integers, i.e. 1, 2, 3, 4, and the whole gang -- we're not paying attention to those with decimals or negatives or any of those crowds.**

A prime number is a number that can only be divided by itself or 1. So 2 is a prime number. In fact, 2 is the only even prime, since all other even numbers can be divided by 2.
Then 3 is a prime.
4? NO!!! because 4 = 2 x 2
5? check, it's a prime.
6 = 2 x 3 so no!
7 is a prime.
8 = 2 x 2 x 2 (or 2 x 4). NO PRIME FOR YOU!
9 = 3 x 3. No prime here.
10 = 2 x 5. Not a prime.
11 -- It's a prime!!
12 = 2 x 2 x 3 (= 3 x 4 = 2 x 6). Definitely not a prime.
So you get the idea?
The first 15 primes are: 1, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43.
I won't tell you what the largest primes are, because the one they just discovered in the past month has 17,425,170 digits. So yeah, I don't have the time to post it right now.

So there you have it. This hopefully gives you the basic information needed to read through the post below. Let me know if you would like any other mathematical clarification!

Tuesday, February 12, 2013

How did I not realize this when I was studying math??

Disclaimer: The following may appear to be pointless mathematical ramblings to some. But I think it contains useful tools for people who at some point will help their children learn multiplication and division. Besides math plays a part in so many different parts of the average person's life, how can it be pointless?



Yesterday I was thinking about prime numbers again. Yes, I do in fact do that. I was wondering if I could figure out some new trick or two to spend even less times checking if a number is a prime or not, at least with 2-digit numbers.

First, it helps to know which primes need to be considered. Any integer below 100 that can be divided into two integers has at least one factor smaller than 10. That helps. So all 2-digit non-primes are multiples of at least one of the prime numbers 2, 3, 5, 7. It's nice the list is so short.

Of course, all the numbers that end in 0, 2, 4, 5, 6 and 8 are the multiples of 2 and/or 5. So that leaves us with the numbers ending in 1, 3, 7 and 9. But fortunately there's only two primes to consider: 3 and 7.

And then the multiples of 3 are also easy to pick out because the sum of the digits is a multiple of 3 (so if you're not sure about the sum of those digits, execute the same process with the digits in that sum and so on until you get to a 1-digit number; the original number -- along with any and all in-between sums -- is a multiple of 3 if you end up with 3, 6 or 9). Thus, it's a breeze to take a number like 87 and go: 8 + 7 = 15 Check! It's a multiple of 3 (1 + 5 = 6) so 87 is not prime. Or with 43: 4 + 3 = 7 so it's not a multiple of 3 (and we already know it's not a multiple of 2 or 5 either).

So the only check that might take some thinking (if your multiplication tables are not at the forefront of your mind) is checking if the number in question in a multiple of 7.

Going through multiples of 7 between 10 and 100, but skipping the multiples of 2, 3 & 5, we are left with: 49, 77, 91 (7 x 7, 11 and 13 respectively)
That's it! All other 2-digit numbers that you don't recognize as a multiple of 2, 3 or 5 is a prime number! Isn't that convenient to know?

In fact you can apply the same method of only taking the time to check against 7 for numbers up to 120, since the first non-prime number that has no factors smaller than 10 is 11 x 11 = 121.

If you want to keep going, you only need to spend time checking against 7 and 11 (2-digit numbers: both digits are the same; 3-digit numbers: the middle digit is the sum of the two side digits) for numbers up to 168, since 13 x 13 = 169. And really, how often do you need to find the prime factors of numbers greater than 150?

Yes, this is how I occupy my mind sometimes.

If I went through some point too quickly, please do ask for more elaboration. This is a hobby I consider fun, and I'd be happy to comply.