home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: sci.math
- Path: sparky!uunet!wri!news
- From: roach@bikini.wri.com (Kelly Roach)
- Subject: u(v^n)w prime puzzle SOLUTION
- Message-ID: <1992Aug21.220719.16092@wri.com>
- Sender: news@wri.com
- Nntp-Posting-Host: bikini.wri.com
- Organization: Wolfram Research, Inc.
- Date: Fri, 21 Aug 1992 22:07:19 GMT
- Lines: 86
-
-
-
-
- Prove or disprove: There are three non-empty
- strings of digits u,v,w such that all the
- numbers in
- L = {u(v^n)w | n is a natural number}
- = {uw, uvw, uvvw, uvvvw, uvvvvw, ...}
- are prime numbers.
-
-
- THE SOLUTION
-
- I've seen some good solutions to my puzzle already,
- but as promised, I now present the solution I said I would
- post on Friday (today).
- Let a=|v|=length of v, b=|w|=length of w. Then
-
- u(v^n)w = u*10^(a*n+b) + v*Sum[10^(a*i+b),{i,0,n-1}] + w
-
- Fermat's Little Theorem says
-
- c^(p-1) = 1 (mod p)
-
- if p is prime and (c,p)=1. If uw is not a prime, there
- is not much to prove. So, let p=uw be prime. If
- (p-1) | n, then by F.L.T.
-
- u*10^(a*n+b) + w = u*10^b + w = uw = 0 (mod p)
-
- All that remains is to arrange things so that
-
- Sum[10^(a*i+b),{i,0,n-1}] = 0 (mod p)
-
- Prime number p does not divide 10 because uw has at least
- 2 digits. Hence
-
- 10^(a*i+b) (mod p)
-
- is a periodic function of i. The period divides p-1
- and that means that if p(p-1) | n, then each residue
- appearing in the list
-
- 10^b, 10^(a+b), ..., 10^(a*(n-1)+b) (mod p)
-
- appears a multiple of p times. Consequently, it is
- sufficient to let n=p(p-1) to get p | u(v^n)w. Obviously
- u(v^n)w > p=uw.
-
- QED
-
-
- It is possible to make n smaller in my proof
- by using p*ord(10,p) instead. Also, Arthur Rubin
- suggests using p=uvw and n=p. Then
-
- u*10^(a*n+b) + vw = u*10^(a+b) + vw = uvw = 0 (mod p)
-
- Sum[10^(a*i+b),{i,1,n-1}]
- = (10^(a*(p-1))-1)/(10^a-1) * 10^(a+b)
-
- The Sum is divisible by p since p > 10^a-1 and F.L.T.
- applies to 10^(a*(p-1))-1.
- There were two other nice solutions posted which
- reduced the problem to an instance of the more general
- problem of whether
-
- x_{n+1} = a*x_n + b
-
- could always be prime and then solved that problem.
- About the u(v^n)w puzzle itself: It arises from
- the problem of investigating whether any regular language
- can generate only prime numbers. There is a pumping
- lemma for the regular languages which basically reduces
- the problem down to the u(v^n)w puzzle which I posted
- to sci.math. So, everyone who solved my puzzle also
- just proved that no finite state machine can accept
- an infinite language consisting of only prime numbers.
- If you generalize the proof a bit, you can also prove
- that u(v^n)w(x^n)z with |vx| != 0 cannot generate all
- prime numbers either. This shows that no infinite
- context-free language can contain only prime numbers.
- I'm pretty sure these are old results.
-
-
-
-