# Prime Cell Phones

Gold Member
I was playing with Wolfram|Alpha, and I typed in my ten-digit phone number. And it was prime! I have a prime cell phone number!

Of course, I tried this with other numbers... my SSN isn't prime, and neither is my dad's phone number. My seven-digit phone number can be divided by two square numbers... so it's really not prime...

But I still find the prime phone number interesting.

Question 1:

Do any of you have prime phone numbers? (You don't have to say what the number is)

Question 2:

Does anyone know the probability of a ten-digit phone number being prime?

Office_Shredder
Staff Emeritus
Gold Member
The distribution of primes is approximately x/ln(x) of the numbers up to x are prime. So numbers that are smaller than 1010, gives us 4.3 times 108 primes. So the odds of being prime are about 4.3%

This is a rough estimate of course

My phone number is even, so there you go

I feel like optimus prime when I use my phone. Does that count?

DaveC426913
Gold Member
The distribution of primes is approximately x/ln(x) of the numbers up to x are prime. So numbers that are smaller than 1010, gives us 4.3 times 108 primes. So the odds of being prime are about 4.3%

Correct me if I'm wrong but that's all numbers down to 1 digit.

What we want is the probability of only 10-digit numbers.

CRGreathouse
Homework Helper
Correct me if I'm wrong but that's all numbers down to 1 digit.

What we want is the probability of only 10-digit numbers.

They're about the same. In general x/log x is a slightly better estimate of the numbers around x than the numbers 1 to x, though -- compare x/log x to Li(x) to see why.

But as it happens there are 404204977 10-digit prime numbers, so if all 10-digit numbers were valid phone numbers then the probability would be exactly 4.04204977%.

It looks like there are 5,702,328,000 valid NANPA (US) phone numbers. Such phone numbers can't start with 1, so that will change the probability slightly. (The other restrictions shouldn't change the probability much.)

Last edited:
How can I check this (without blowing any brain fuses over too complicated mathematics)?

CRGreathouse
Homework Helper
How can I check this (without blowing any brain fuses over too complicated mathematics)?

Generate 10-digit numbers at random and check if they're prime.

I generated a million random numbers from 2000000000 to 9999999999, of which 4.0785% were prime. It took about 5 seconds in Pari:
Code:
test(lim)=sum(i=1,lim,isprime(random(10^11-10^10*2)+10^10*2))/lim*1.
100*test(1e6)

Heh... I'm sure that looks *yawningly* simple to you, but I am a mathematical illiterate, so I really need to be gently taken in hand and shown the way here. Is there a place where I can type in my actual phone number and have it answered within seconds?

CRGreathouse
Homework Helper
Heh... I'm sure that looks *yawningly* simple to you, but I am a mathematical illiterate, so I really need to be gently taken in hand and shown the way here. Is there a place where I can type in my actual phone number and have it answered within seconds?

Sure, http://www.usi.edu/science/math/prime.html [Broken] .

Alternately, download Pari/GP (click on "Windows binary" if you're on Windows) which lets you check more than one at a time, for example with the above program.

Last edited by a moderator:
Sure, http://www.usi.edu/science/math/prime.html [Broken]

OK, it can be divided by 2... which I suppose is as far away from a prime as you can get... but then again, would any 10 digit number that ends with a 0 be a prime?

Last edited by a moderator:
DaveC426913
Gold Member
... would any 10 digit number that ends with a 0 be a prime?

No. A number ending in zero is divisble by 2.

Sure, http://www.usi.edu/science/math/prime.html [Broken] .

OK, it can be divided by 2... which I suppose is as far away from a prime as you can get...
[ribbing]
If you had to check the link to find out whether your even number is prime, then you weren't kidding about being mathematically illiterate, were ya?
[/ribbing]

Last edited by a moderator:
No kidding! But are all numbers that end in a zero also divisble by five?

CRGreathouse
Homework Helper
OK, it can be divided by 2... which I suppose is as far away from a prime as you can get... but then again, would any 10 digit number that ends with a 0 be a prime?

No prime ends with 0, 4, 6, or 8; only one prime ends with 2; only one prime ends with 5.

In fact, no prime ends with 0 in *any* composite base, and the only prime ending with 0 in a prime base is the prime itself (which is "10").

I checked my number but it's not a prime, however it has four independent Pythagorean triples.

That is it has 4 sets of:

Phone #^2 = x^2 + y^2

where x,y are integers

What are the odds on that?

Last edited:
CRGreathouse
Homework Helper
What are the odds on that?

Asymptotically, almost all numbers are composite and almost all numbers cannot be expressed as the sum of two squares. But, trivially, all squares can be expressed as the sum of two squares, so it's just a question of how many times. This varies, of course, depending on how you count it. See
http://mathworld.wolfram.com/SumofSquaresFunction.html

Last edited:
Heh... y'all make math sound sexy now. Maybe I'll have to sign up for some tutoring just to be able to follow the conversation.

Gold Member
Er... Jack... everyone can see your prime phone number. I'm not sure if you want that information to be kept hidden or not...

Is that true, that every square number can be written as the sum of two squares?

(Wait, never mind, I proved that myself a while ago... I don't need an answer there...)

All even phone numbers are composite. All phone numbers ending in five are composite (as there is no area code 000).

But the only way to calculate all possible prime phone numbers is through checking each number, isn't it?

Approximations are, after all, approximations.

Er... Jack... everyone can see your prime phone number. I'm not sure if you want that information to be kept hidden or not...

There are 226 phone numbers on that page.

If somebody wants to go through all 226 of them to try and reach me, they're free to do so.

CRGreathouse
Homework Helper
It also gives away your state, city, and carrier (Global Crossing Local Services, unless you transferred the number).

I'm clearly not worried about privacy online, considering that I use my real name here. But some people are...

CRGreathouse
Homework Helper
But the only way to calculate all possible prime phone numbers is through checking each number, isn't it?

No -- but since there are some very small-scale rules like those on connection 555, it's probably the fastest.

Well, actually, I'm not sure now that I think about it. If you subtract those off by calculating them directly, the gaps between the remaining blocks are small enough that the Meissel-Lehmer algorithm could easily be competitive.

CRGreathouse
Homework Helper
Heh... y'all make math sound sexy now.

That's only `cause it is.ɦ

Lets see... Char's name has a 'Z', his phone number is prime, he's 17, and he lives in Canada. This should make my stalking him much simpler.

Gold Member
Except I don't live in Canada...