Search This Blog

Showing posts with label Prime. Show all posts
Showing posts with label Prime. Show all posts

09 April 2013

A224502: Prime numbers (together with one) whose representation in balanced ternary are palindromes.

Quite often when I am doing prime number research and/or looking for patterns, I check the various number sequences against OEIS to see what other algorithms would come up with the same sequence. Usually, every sequence I look for is in there.  For example:

A005408 - Odd Numbers
A000010 - Totients
A007318 - Pascal's Triange

And, now that I have published my first sequence to OEIS:
A224502 - Prime numbers that are Palindromes in Balanced Ternary Notation

For example:
For n=5, a(5)=61 and in balanced ternary notation is 1ī1ī1.

16 June 2009

Slashdot: 47th Mersenne Prime Confirmed

The new prime, 2^42,643,801 - 1, is actually smaller than the one discovered previously.

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

similarly...
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

etc

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.

27 July 2007

Intuitive Approach to Wilson's Theorem

The other day I stumbled across something, only later to realize that it was Wilson's Theorem. Since the approach used to find it in the first place was more of a 'common-sense' approach than what you usually encounter for it, I thought I would go ahead and present it.

Let's look at two examples.... For both, what we are looking for is:
(n-1)! % n ≡ (n-1) mod n; iff n is prime

Example 1: Composite Numbers
Let's try to determine whether '10' is prime (which we know it isn't but that just makes the example easier to follow)...
(n-1)! is 1*2*3*4*5*6*7*8*9
when we mod it by 10, what we are really saying is to "find missing factors of 10"
since both 2 and 5 are in the list, the end result will be 0*
ie: (10-1)! % 10 ≡ 0 mod 10

Example 2: Prime Numbers
Let's try to determine whether '11' is prime
(n-1)! is 1*2*3*4*5*6*7*8*9*10
when we mod by 11, what we are really saying is to "find missing factors of 11"
since 11 is not in the list, the number is prime and the end result is 10 (or -1)
ie: (11-1)! % 11 ≡ 10 mod 11
or: (11-1)! % 11 ≡ -1 mod 11

* It appears that the only composite number to NOT result into congruency with 0 is '4'
(4-1)! % 4 ≡ 2 mod 4
I believe this is because it is 2-squared and it 2-away from it... thus since we get further away as we go on, it won't happen again.


Unfortunately, this didn't end up being nearly as clear as my first draft did, but let's try to make the useful bit clear here... directly from Wilson's theorem:

(n-1)! % n ≡ -1 mod n; iff n is prime
or
(n-1)! % n = (n-1) mod n; iff n is prime

or... to put it into Windows Calculator speak:
[type in some number][M+][-][1][=][n!][mod][MR][=]
if the result is equal to [MR]-1 then it is prime
otherwise the result will be 0 (or '2' for n=4) and the number is composite/non-prime

06 May 2007

Coprime, aka. Relatively Prime

Two numbers are coprime (relatively prime) if they have no factors in common.
I thought this image from Wikipedia was a good visual way of seeing it:

Figure 1. The numbers 4 and 9 are coprime because the diagonal does not intersect any other lattice points

26 January 2007

Twin Primes

So as I rewrite my Balanced Ternary (ī,0,1) library once again, something occurs to me...

While it is not visually obvious which numbers are multiples of two, we do know that all multiples of 3 end in 0. Since no prime (except 3) can be a multiple of 3, that means that all primes are going to end in ī or 1. Well, since we know all primes are odd, that also means that the specific number with a 0 ending would have also been a multiple of 2. IE: The number ending in 0 would have been a multiple of 6.

Where am I going with this? Well, let's look at the first few multiples of 2*3
6 - 5 and 7 are twin primes
12 - 11 and 13 are twin primes
18 - 17 and 19 are twin primes
24 - 23 and 25... nope, not that one (23 is prime though, other is 52)
30 - 29 and 31 are twin primes
36 - 35 and 37... nope, not that one (37 is prime though, other is 5*7)
42 - 41 and 43 are twin primes
48 - 47 and 49... nope, not that one (47 is prime though, 49 is 72)
54 - 53 and 55... nope, not that one (53 is prime though, other is 5*11)
60 - 59 and 61 are twin primes
66 - 65 and 67... nope, not that one (67 is prime though, other is 5*13)
72 - 71 and 73 are twin primes
80 - 79 and 81... nope, not that one (79 is prime though, 81 is 92)

well obviously that wasn't the "correct solution"...

let's start with a simple question - did we miss any twin primes?
well we miss (3,5) - but that could just be because we were specifically looking for multiples of 6.
other than that, we did not skip any twin primes

what about those 'extra' entries?
well some are when we have squares (52, 72, 92)
the others are 5*{7,11,13}
could be a pattern there... partial one anyways...

let's look at it from another aspect... what primes did we miss?
obviously anything below 6 since we started with multiples of 6
other than that, we got all primes...
and 6 extra values below 82... so about 7% too many

it has to become less usable as we get higher, doesn't it?
600 - 599 and 601 are twin primes
606 - 607 is prime
612 - 613 is prime
618 - 617 and 619 are twin primes
624 - (neither 623 or 625 are prime)
630 - 631 is prime
636 - (neither 635 or 637 are prime)
642 - 641 and 643 are twin primes
648 - 647 is prime
652 - 653 is prime
660 - 659 and 661 are twin primes

and no primes are missing (though a couple extras)

18 January 2007

Prime Numbers, Assumptions and Thoughts

Prime numbers have been a challenge to people for a very long time. If they are something that we still can't write an equation for, perhaps it is time to challenge our assumptions about these fascinating and extremely important numbers.

First, it is commonly believed that there is no pattern to prime numbers. Research studied under this belief might very well be simply falling prey to self-fullfilling prophecy. We know that prime numbers do indeed have a pattern. How? Because color-coding a Pascal Triangle to look like a Sierpinski Gasket shows that prime numbers form perfect fractals, while composite numbers show overlapping fractcals. I discussed this a little while ago. Using this method, with just a couple sentences of explanation, ANYONE can look at a picture (mod some number) and tell you if it is a prime number or not (primes look clean, composites look cluttered). The pattern is visually obvious.

Second, let's tackle the concept that '1' is not a prime number... Some people will tell you that '1' isn't prime because it doesn't fit the rules. Others because it isn't convenient. Still others say it was due to the Greeks thinking number games weren't as challenging with it. Hell, you are probably wondering why we even care... Simple: If '1' IS a prime number, then all the equations that don't quite work change... the math changes... We get rid of "except 1" or ">=2" type of exceptions... but most importantly, because it would force us to look at things differently -- which is what we desperately need if we are going to 'solve' primes.

So, what about the argument that it doesn't fit the rules? What is the definition of a prime number? Generally, people assume it is "any number greater than 1 that has only 1 and itself as factors".. So 1*3 is prime because no other number is a factor. 1*4 is not prime because 2 is a factor. 1*1 has no other factors, therefore it should be considered prime. But, you also see why people have a problem with it. Because it is also a square ;) They always say "1 and itself"... Well, under that definition '1' should be prime. The only reason they say it isn't is because they add the clause "greater than 1" or "except 1" to the rule. Occam's razor fans should be well aware of the problem here. You don't add a single exception (for a number that would otherwise work) just because you don't like or understand it.

You are probably still wondering why we care... Let's say you are writing an equation... f(n)=nth prime. Well, if '1' is prime, then all the current attempts are actually doing f(n)=(n+1)st prime... thus patterns may be easier to see if we quit assuming 1 can't be prime.

What other assumptions do we have? Primes get further and further apart... Not true... No matter how high you go, there will be twin primes. This tells us that twin primes are not a special case or exception -- but are in fact part of the pattern. And don't forget what we said earlier -- it is a fractal -- so it repeats forever.

In fact, the whole concept that there are 'types of primes' is simply a misnomer. Each type of prime is simply a subset of the fractal.

17 January 2007

Slashdot | Largest Twin Prime Yet Discovered

The Twin Internet Prime Search and PrimeGrid have recently discovered the largest known twin prime. A twin prime is a pair of prime numbers separated by the integer two. The pair discovered on January 15th was 2003663613 * 2195,000 ± 1. The two primes are 58,711 digits long. The discoverer was Eric Vautier, from France.