# 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?

Staff Emeritus
Gold Member
2021 Award
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

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

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.

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:
Max Faust
How can I check this (without blowing any brain fuses over too complicated mathematics)?

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)

Max Faust
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?

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:
Max Faust
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:
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:
Max Faust
No kidding! But are all numbers that end in a zero also divisble by five?

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").

waht
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:
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:
Max Faust
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.

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

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

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.

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

That's only `cause it is.ɦ

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

Kajahtava
Okay, I've got an algorithm running right now which should give me the amount of ten digit primes, if any one has a faster computer than I and runs scheme, or has some pointers on reducing complexity:

I have no idea how long this will take, I made the algorithm to compute the list of primes a while ago, hence it has comments. In theory it should compute a list of all primes smaller than 999999999 and then count the the amount that are higher than 1000000000.

Jimmy Snyder
Unfortunately, my phone number is not a prime. But the good news is that my age, 59, is a prime, or will be for a little while more. Next month my age won't be a prime any more, although I can't imagine how 59 will get split up. For my birthday, my wife will take me out for prime rib, That is, USDA prime beef. That's number 1 with me even though 1 is not actually a prime. I'm in the prime of life too, what a coincidence. They call it prime time and it shows what can come of a society that primes the pump by educating its young. Life is grand, the prime rate is low, the Prime (no pun intended) Minister is ministering out there by the prime meridian, my primary care physician is in good health, my house is in a prime location and I'm not a prime suspect in any investigation.

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

Let me guess what you mean...

$$4 = 2^2 = (\sqrt 1)^2 + (\sqrt 3)^2$$

Actually, I think same holds for every number. Like

$$7 = 2^2 + (\sqrt 3)^2$$

7 is a prime, which makes the result even more interesting... But then,

$$7 = (\sqrt 7)^2$$

so 7 is a square.

Last edited:
Kajahtava
I think a square number means a number whose root is an integer.

Which makes it true, because 0 is a square number by the above definition.

Mentor
Technically you are right, but allowing zeros makes it trivial (every square number equals itself is hardly surprising).

Pythagorean triples (with three positive integers) are much more interesting.

TheStatutoryApe
Except I don't live in Canada...

Its not nice tricking people into thinking that you live in Canada.

Vasara
Tangentially related: both my birthday and month of birth are prime and together they form a http://en.wikipedia.org/wiki/Sexy_prime" [Broken] pair. Yay.

None of my phone numbers are prime though.

Last edited by a moderator:
Homework Helper
Tangentially related: both my birthday and month of birth are prime and together they form a http://en.wikipedia.org/wiki/Sexy_prime" [Broken] pair.

May 11th, July 13th, November 5th, or November 17th, then.

Last edited by a moderator:
Homework Helper
Okay, I've got an algorithm running right now which should give me the amount of ten digit primes, if any one has a faster computer than I and runs scheme, or has some pointers on reducing complexity:

I have no idea how long this will take, I made the algorithm to compute the list of primes a while ago, hence it has comments. In theory it should compute a list of all primes smaller than 999999999 and then count the the amount that are higher than 1000000000.

I have that number already -- 404204977. But I don't have the number that excludes area codes starting with 1, certain numbers with connection 555, etc.

$$7 = (\sqrt 7)^2$$

so 7 is a square.

"Square" is surely used in its number theory sense here, as Kajahtava suggests.

Homework Helper
What if where you live they don't have 10 digit phone numbers?
Well anyway, this 8 digit number of mine is even so... I'm one of the special ones that has a composite phone number.