Search This Blog

18 May 2009

Primality of 1

When I was in school, I remember them teaching that a prime number was any number divisible by only 1 and itself. Thus, in school, they taught that 1 was prime. Since then, I have noticed that everyone insists that 1 is not prime. Since many of the patterns I find work better with 1 being prime, I decided to try to figure out why the discrepancy...

From Wikipedia:

Until the 19th century, most mathematicians considered the number 1 a prime, with the definition being just that a prime is divisible only by 1 and itself but not requiring a specific number of distinct divisors. There is still a large body of mathematical work that is valid despite labelling 1 a prime, such as the work of Stern and Zeisel. Derrick Norman Lehmer's list of primes up to 10,006,721, reprinted as late as 1956,[2] started with 1 as its first prime.[3] Henri Lebesgue is said to be the last professional mathematician to call 1 prime.[citation needed] The change in label occurred so that the fundamental theorem of arithmetic, as stated, is valid, i.e., “each number has a unique factorization into primes.”[4][5]
So there you have it. They decided in the last 43 years that 1 could no longer be prime so that one of their theorems could be correct. Why does that remind me of someone fudging statistics?

I know, I know... soapbox, right? First the divide-by-zero post, then this... How about this, as soon as we can explain all our math in simple fractals without saying things like "except 0 or 1" or "with n>1", then I'll change my position on it.

Thus Theorem 1 of Hardy & Wright (1979) takes the form, “Every positive integer, except 1, is a product of primes”
bah humbug ;)

17 May 2009

Prime digits

A coworker made a comment to me Friday about the distribution of digits in prime numbers. He was referring to a recent Slashdot article talking about the first digit in the prime number...

but I have never liked thinking of the 1st digit as the far left... I'd prefer to think of the far right digit as digit 0. Can't help it - it's the whole positional notation thing (10^3 10^2 10^1 10^0 . 10^-1 10^-2 etc)...

So I started looking at the distribution of the primes on the right side.

The last digit (digit 0, far right digit) is directly related to the number of primes...
Now 2 and 5 are both used once (for themselves).
0,4,6 and 8 are never used.
1,3,7,9 all follow this pattern:

Assume {x} = {1,3,7,9}
Assume {y} = {all primes < 10^n}
let z = ({y} ≡ x (mod 10^n))
z is also the number of times that x was the last digit in {y}

So let's look at a simple example...
{y} = {all primes < 10000}

0 was never the last digit
1 was the last digit 307 times (if you count 1 as prime, 306 otherwise)
2 was the last digit once ('2')
3 was the last digit 310 times
4 was never the last digit
5 was the last digit once ('5')
6 was never the last digit
7 was the last digit 308 times
8 was never the last digit
9 was the last digit 303 times

there were 307 primes ≡ 1 (mod 10000) [assuming 1 counts as prime]
there was 310 primes ≡ 3 (mod 10000)
there was 308 primes ≡ 7 (mod 10000)
there was 303 primes ≡ 9 (mod 10000)

For {y} < 100000, we have
0 2388 1 2402 0 1 0 2411 0 2390

For {y} < 1000000, we have
0 19618 1 19665 0 1 0 19621 0 19593


Checking OEIS, I found those sequences listed here:
A073505 for 1 (if 1 is *NOT* prime)
A073506 for 3
A073507 for 7
A073509 for 9

A006880 seems to be the SUM of each line
Example: 0+307+1+310+0+1+0+308+0+303=1230 [-1 for the sequence due to 1 being prime or not] < 10^4

So it doesn't really get us much... but it does tell us that the number of primes ending in X is equal to the number of primes congruent to X mod 10^n.