The Math Forum

Ask Dr. Math - Questions and Answers from our Archives
Associated Topics || Dr. Math Home || Search Dr. Math

Prime Numbers in Different Bases

Date: 10/07/98 at 21:18:07
From: Jorge Diaz
Subject: Prime numbers

Hi, Dr. Math,

Here is a question I have for you.  It's on prime numbers.

Are all prime numbers the same in all bases? If 21 is a prime, are 
10101 (in binary), and 15 (in hexadecimal) also primes?  

I'm taking a course in Assembly Language Programming, and I was 
wondering if primality as such is related at all to the number system 
I am using?  What would happen, for instance, if I chose as a base a 
prime number, such as thirteen?

Also, I've recently begun to study fractal geometry, a subject which, 
along with chaos theory, I find fascinating.  I have a strong 
suspicion that the distribution of prime numbers might be related to 
fractal geometry, and if I had enough time I would perhaps pursue this 
subject. By taking a peek at your files, I was able to gather that 
there is no polynomial function f(n) that will give a list of all the 
primes, but I was wondering if log f(n) might, if f(n) were at the 
limit of an infinite interation of the same function, or the limit of 
an infinite composition of a function with itself, iff, that is, both 
things are otherwise equal.

I would appreciate any insight you might have on this matter.

Thank you.
Jorge Diaz

Date: 10/07/98 at 23:34:01
From: Doctor Mike
Subject: Re: Prime numbers

Hi Jorge,    

A prime is a prime no matter which base you use to represent it. On 
the surface one might think that in Hex you would have 3*5 = 15 as 
"usual," but it really turns out that 3*5 = F. 

The example 21 doesn't work too well because it is not prime. 
The base ten number 37 is better, because it is prime, but its Hex 
representation is 25, which sort of looks non-prime. Hex 25 is not, 
however, repeat not, 5 squared.
Okay, enough for examples. The fact of being prime or composite is 
just a property of the number itself, regardless of the way you write 
it. 15 and F and Roman numeral XV all mean the number, which is 3 
times 5, so it is composite. That is the way it is for all numbers, in 
the sense that if a base ten number N has factors, you can represent 
those factors in Hex and their product will be the number N in Hex.   
Relating to your question about base 13, the base ten number 13 will 
be represented as "10" in that system, but "10" will still be a prime, 
because you cannot find two numbers other than 1 and "10" that will 
multiply together to make "10". 

I hope this helps you think about primes in other bases.

I don't have any insight into fractal geometry and primes, except to 
say that you will probably be wise to pursue your interest in chaos 
and fractals. There may be something in there of interest for you to 

- Doctor Mike, The Math Forum   
Associated Topics:
High School Number Theory

Search the Dr. Math Library:

Find items containing (put spaces between keywords):
Click only once for faster results:

[ Choose "whole words" when searching for a word like age.]

all keywords, in any order at least one, that exact phrase
parts of words whole words

Submit your own question to Dr. Math

[Privacy Policy] [Terms of Use]

Math Forum Home || Math Library || Quick Reference || Math Forum Search

Ask Dr. MathTM
© 1994- The Math Forum at NCTM. All rights reserved.