-   Information & Answers (
-   -   Social Security Number (

Unregistered 2008-10-25 03:49

Social Security Number
I'm not sure if people who are not in the programme can ask questions, and I'm also not sure if I can ask questions that are not about the programme (GIMPS), but as this place seems to be full of guys who know stuff about prime numbers I will ask anyway, and if that strikes anyone as rude then I'm sorry.

A friend asked me the following question:

I have an eleven-digit prime number (he actually said it was a Social Security Number but that is largely irrelevant). The first 7-digits form a prime, the first 8-digits form a prime and the first 9-digits form a prime. What is the probability of such a number occurring?

[i]I am not interested in the probability part of his question.[/i] What appealed to me was the challenge of writing a programme to find his number. It turns out the number is not unique and I have so far found just under 5,000 of them.

Looking at the numbers kicked out by my programme I noticed something quite odd about them. To understand what is odd about them I need to explain how I searched for them.

I looked initially for 9-digit prime numbers with their final three digits all in the set [1, 3, 7, 9], like this: 100069733, 100093199, 100102799, 100138979. Then I confirmed that the 8-digit and 7-digit truncations of them were also prime. Lastly, I added a 2-digit extension to them and checked for primality. It is this final 2-digit extension that interests me.

There are obviously 40 valid combinations in the set, [11, 13, 17, 19, 21, 23, 27, etc] and I was expecting these to be represented in some arbitrary distribution. However, every single one of the numbers I have found ends with the 2-digit combination 11, as follows: 10006973311, 10009319911, 10010279911, 10013897911, 10014113311, 10022599711, 10026239911, 10034639911, 10039633711, 10039637911.

Admittedly, having found only 5,000 of them may seem a small sample from which to be drawing conclusions, but I was wondering if there is some mathematical explanation for this curiosity?

I thought it might have to do with congruence so have looked, briefly at that. The following table shows what I found.


From the fact that all of the 9-digit numbers = 5(mod 6) we can see that our list of possible 2-digit extensions has 12 values that won't work. These are [ 13, 19, 31, 37, 43, 49, 61, 67, 73, 79, 91, 97] all of which would require the 11-digit number to be = 3(mod 6) and therefore not prime. but the other 28 values all work (from this point of view).

Next, I considered a fault in my programme. The 2-digit combinations are stored in an array and it struck me as possible that the routine for cycling through the array was not functioning properly. So I checked this by getting an output file of the numbers rejected at this stage and they show examples of all the other combinations. That obviously does not exhaust the possibility for fault with my programme, but it is not going to be something trivially obvious.

So, my question is:

Is there a mathematical explanation for these numbers all ending with 11?

Jens K Andersen 2008-10-26 03:23

I guess your program has a bug but I cannot say where without seeing the source. Here is a primitive PARI/GP search:
? for(p=1000000,1000100,if(isprime(p),for(d=1,9,q=10*p+d;if(isprime(q),for(e=1,9,r=10*q+e;if(isprime(r),for(f=11,99,s=100*r+f;if(isprime(s),print(s)))))))))

If it's modified to only test numbers ending in 11 then it gives your list of numbers:
? for(p=1000000,1004000,if(isprime(p),for(d=1,9,q=10*p+d;if(isprime(q),for(e=1,9,r=10*q+e;if(isprime(r),for(f=11,11,s=100*r+f;if(isprime(s),print(s)))))))))

axn 2008-10-26 05:37

The very first eligible 9 digit number (100008133) yields the following primes:


Oleg V.Cat 2008-10-26 10:24


Loks like that are just two 10 digits prime numbers, which are under the following rules:

First digit is a prime.
First 2 digits form a prime
First n-1 digits form a prime.

Numbers are:

If we need 11 digits number, then we must use 10, 40 or 82 as first two digits (so, only 3,4,5...10 first digits form a prime), full result set with 11 and more digits is:

Intresting, that digits "1" and "7" are rare, average probability for all 4 possible digits (1,3,7,9) must be 0.25, but we have only 0.025 for "7" and 0.05 for "1".

Jens K Andersen 2008-10-27 02:33

[QUOTE=Oleg V.Cat;146613]First digit is a prime.
Intresting, that digits "1" and "7" are rare.[/QUOTE]

You appear to include 1 in the primes. This is rarely done today. If 1 is not considered prime then we get the right-truncatable primes in [URL=""]A024770[/URL]. There are 83 in total and the largest is 73939133.

Your 4099339193933 is listed at [URL=""][/URL]. My submitted numbers included 133028062963 which is the smallest prime where a prime-making digit can be appended 14 times, ending with 13302806296379339933399333. Can you find a 15?

The many 3's and 9's is no coincidence. Appending 3 or 9 to a decimal number does not change the value modulo 3. But appending 1 or 7 increases the value modulo 3 by 1. If it was 2 before then it becomes 3 (or congruently 0) and thus divisible by 3. If it was 1 then it becomes 2, and will become divisible by 3 next time a 1 or 7 is appended. So at most two 1's or 7's in total can be appended.

My website has another variation at [URL=""][/URL] where two decimal digits are appended at a time. Let p110 =
p110 gives 55 primes after 2, 4, 6, ..., 110 digits. An exhaustive search showed this is maximal for primes starting with 11. Exhaustive searches for all other starts would be feasible but take longer than I'm willing to do.

Oleg V.Cat 2008-10-27 03:48

[quote=Jens K Andersen;146715]You appear to include 1 in the primes. This is rarely done today. [/quote]

Yep, I re-read the definition. Prime numbers must have two different dividers, not one :smile:.

[quote=Jens K Andersen;146715]numbers included 133028062963 which is the smallest prime where a prime-making digit can be appended 14 times, ending with 13302806296379339933399333. Can you find a 15?[/quote]

Oh, no... I am not so addicted to primes :smile:

Unregistered 2008-10-27 08:44

Jens and axn1,
I think computer bugs have evolved to be the principal cause of male pattern baldness!

Nevertheless, I found it. Thanks to your work I knew I was looking for a bug that actually existed. This is much better than looking for speculative bugs, so thank you very much for your help.


All times are UTC. The time now is 04:21.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.