[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference rusure::math

Title:Mathematics at DEC
Moderator:RUSURE::EDP
Created:Mon Feb 03 1986
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2083
Total number of notes:14613

1537.0. "Expandable Primes" by CLT::TRACE::GILBERT (Ownership Obligates) Fri Jan 03 1992 13:46

How far can you build onto a single-digit prime number by adding single
digits to the left and still have prime numbers?  For example:

		  7
		 37
		137

No zeros, please.
T.RTitleUserPersonal
Name
DateLines
1537.1ZFC::deramoDan D'EramoFri Jan 03 1992 20:183
I know the answer for 2 and 5. :-)

Dan
1537.2ZFC::deramoDan D'EramoFri Jan 03 1992 22:2624
At one digit there are four primes.  These extend to eleven two-digit
primes that end with one digit primes.  These extend to 39 three-digit
primes that end with...etc.

	length		count
	------		-----
	   1		   4
	   2		  11
	   3		  39
	   4		  99
	   5		 192
	   6		 326
	   7		 429
	   8		 521

Of the 521 eight-digit primes, 283 ended with 3 and 238 ended with 7.

I expect, of course, the counts to peak then decline and that there is
a length n at and beyond which the counts are all zero.

Dan

p.s.  For all of you fans of Konig's Lemma, it would apply here if the
counts were nonzero for every length. :-)
1537.3ZFC::deramoDan D'EramoThu Jan 09 1992 21:0620
re .2,

>	length		count
>	------		-----
>	   1		   4
>	   2		  11
>	   3		  39
>	   4		  99
>	   5		 192
>	   6		 326
>	   7		 429
>	   8		 521

I extended the table to

	   9		 545
	  10		 517
	  11		 448

Dan
1537.4CLT::TRACE::GILBERTOwnership ObligatesTue Jan 28 1992 17:051
    The longest one is this 24-digit prime: 357686312646216567629137.
1537.5!!!CIVAGE::LYNNLynn Yarbrough @WNP DTN 427-5663Tue Jan 28 1992 17:379
>    The longest one is this 24-digit prime: 357686312646216567629137.

Good stuff!

Now if you start trimming digits from the *right* end of this number, the 
first prime you run into is 3576863. However, there is 
3576863126462165676291 = 3 * 1192287708820721892097. Close!

What method/program did you use to get the result?
1537.6CLT::KOBAL::GILBERTOwnership ObligatesWed Jan 29 1992 19:515
    I'm a bit ashamed to admit that I wasted considerable time *factoring*
    all these numbers, when all that was required was determining
    primality, but I used Hallyburton's FACTOR program.  After one 'length'
    of numbers were factored, the primes were found in the output, digits
    prefixed, and these slightly longer numbers fed back into FACTOR.
1537.7The whoooole thingCIVAGE::LYNNLynn Yarbrough @WNP DTN 427-5663Thu Jan 30 1992 20:2962
The complete table is:

	length		count
	------		-----
	   1		   4
	   2		  11
	   3		  39
	   4		  99
	   5		 192
	   6		 326
	   7		 429
	   8		 521
	   9		 545
	  10		 517
	  11		 448
	  12		 354
	  13		 276
	  14		 212
	  15		 117
	  16		  72
	  17		  42
	  18		  24
	  19		  13
	  20		   6
	  21		   5
	  22		   4
	  23		   3
	  24		   1
	  25		   0

The complete list of all extended primes is generated by the following
MAPLE program, in about 30 min on my VS3520: 

#	EXTEND.MAPLE
#
# tenx is a procedure to compute n+10^(digits in n)*[1..9]
# Ex: tenx(35) = 135,235,335,435,535,635,735,835,935
#======================================================================
tenx := proc (n) local i;
    n + i*p10 $i=1..9
    end;

primes_only := proc(xlist) local i, plist;
    plist := [];
    for i from 1 to nops(xlist) do;
	if isprime(xlist[i]) then plist := [op(plist), xlist[i]] fi;
    od;
    plist
    end;

p10 := 10;
prlist := primes_only([i$i=1..9]);

for k from 1 to 25 do:
    xlist := []:
    for i from 1 to nops(prlist) do:
	xlist := [op(xlist), tenx(prlist[i])]:
    od:
    prlist := primes_only(xlist):
    lprint(prlist, nops(prlist));
    p10:=p10*10:
od:
1537.8left-primes: the opposite problem CIVAGE::LYNNLynn Yarbrough @WNP DTN 427-5663Mon Feb 03 1992 14:1324
The following is the complete list of all "left"-primes; if you delete 
digits from the right the "left" of the number is still prime.
The number outside the brackets is the count for each group.

[2, 3, 5, 7]	4

[23, 29, 31, 37, 53, 59, 71, 73, 79]   9

[233, 239, 293, 311, 313, 317, 373, 379, 593, 599, 719, 733, 739, 797]   14

[2333, 2339, 2393, 2399, 2939, 3119, 3137, 3733, 3739, 3793, 3797, 5939, 7193, 
7331, 7333, 7393]   16

[23333, 23339, 23399, 23993, 29399, 31193, 31379, 37337, 37339, 37397, 59393, 
59399, 71933, 73331, 73939]   15

[233993, 239933, 293999, 373379, 373393, 593933, 593993, 719333, 739391,
739393, 739397, 739399]   12 

[2339933, 2399333, 2939999, 3733799, 5939333, 7393913, 7393931, 7393933]   8

[23399339, 29399999, 37337999, 59393339, 73939133]   5

[]   0
1537.9Some odditiesCIV009::LYNNLynn Yarbrough @WNP DTN 427-5663Mon Apr 06 1992 18:337
Buried in the long list of right-primes is the remarkable palindrome

	799636997

The largest number that is both left- and right-prime is 

	739397
1537.10querySGOUTL::BELDIN_RPull us together, not apartMon Apr 06 1992 19:2415
   Re:     <<< Note 1537.9 by CIV009::LYNN "Lynn Yarbrough @WNP DTN 427-5663" >>>

>                               -< Some oddities >-
>
>Buried in the long list of right-primes is the remarkable palindrome
>
>	799636997
>
>The largest number that is both left- and right-prime is 
>
>	739397

   Do you mean absolutely "the largest", or "the largest in some list"?

Dick
1537.11Both listsGLENN::LYNNLynn Yarbrough @WNP DTN 427-5663Mon Apr 06 1992 21:286
>   Do you mean absolutely "the largest", or "the largest in some list"?

I have a complete list of both the left- and right-primes (the list of 83
left-primes appears a couple of notes back; if you really want to see the 
complete list of 4260 right-primes I will mail it). The number I cited is
the largest integer that appears in both lists. 
1537.12Original it's notCIV009::LYNNLynn Yarbrough @WNP DTN 427-5663Mon May 04 1992 14:215
This topic has already appeared in the Journal of Recreational Math (JRM),
as early as 1970. Harry Nelson, one of the JRM editors, has also written
about nests of primes, in which digits are added on *both* ends, and
including two 71-digit primes built that way. The 24-digit prime Peter 
cites early on also appeared in *Mathematics of Computation* back in 1977.
1537.13Adding more insightCIV009::LYNNLynn Yarbrough @WNP DTN 427-5663Mon May 04 1992 14:5824
>>The largest number that is both left- and right-prime is 
>>
>>	739397
>   Do you mean absolutely "the largest", or "the largest in some list"?

I was showing off the MAPLE program that does this stuff at a trade show a 
few weeks back and one customer refused to believe that there are only 
finitely many of these things, so perhaps further explanation is in order.
The process is exhaustive: the program starts with 2,3,5, and 7 and builds
upon them as four branches of a tree. Each branch of the tree grows when
adding a digit produces another prime, and stops growing (e.g. the 2- and
5- branches) when all 9 of its extensions are composite. The whole tree
stops growing at the 24-digit prime. Any prime not in the tree is easy to 
disqualify by starting at the right and comparing: the rightmost substring
not in the tree has been tested by the program and found to be composite. 


The number of primes at each level of the tree, plotted against level, 
looks very much like a Beta Probability Density Function. I suspect that an
analysis of the expected number of primes generated by such a process would
predict such a distribution (or perhaps a Poisson distribution), but I'm
not up to doing the analysis. 

... challenge to the reader?