Prime Generating Lucas Sequences

Prime Generating Lucas Sequences

PRIME GENERATING LUCAS SEQUENCES PAUL LIU & RON ESTRIN Science One Program The University of British Columbia Vancouver, Canada April 2011 1 PRIME GENERATING LUCAS SEQUENCES 2 Abstract. The distribution of prime numbers in Lucas sequences was investigated by independently chang- ing the initial values and the multiplicative constants in the recursive denition of the sequence. The prime distribution was obtained by counting the number of primes in the rst 1000 terms of various Lucas se- quences. It was found that both smaller seeds and smaller multipliers produced more primes on average than if the seeds and multipliers were large. It was also determined that changing the initial seeds produced more primes and more variation in prime counts than changing the multipliers. Introduction. The search for prime numbers is an active aspect of mathematics that appears in several elds, most common of which is in number theory. Prime numbers found in Lucas sequences have been of interest for some time, and have led to several discoveries and the creation of prime tests such as the Lucas-Lehmer Prime Test. These rather special numbers have found various applications in everyday life, such as algorithms and methods for data encryption. Let us dene (informally) Lucas sequences as terms of the following recursive sequence: M(a; b; P; Q): an = P · an−1 − Q · an−2; a1 = a; a2 = b (1) Among the most well-known Lucas sequences are the Fibonacci sequence (an = an−1 +an−2; a1 = 0; a2 = 1), and its complement Lucas sequence (where a1 = 2; a2 = 1). Lucas sequences can also be dened based on their characteristic polynomial X2 − PX + Q, whose roots: p p P + D P − D α = and β = ;D = P 2 − 4Q 2 2 create the sequences α2−β2 (where ), and n n (where ) which Un = α−β a1 = 0; a2 = 1 Vn = α + β a1 = 2; a2 = 1 are complement Lucas sequences. The Lucas sequence for values of P = 3;Q = 2, creates the sequence n Un = 2 − 1, where prime Un are known as Mersenne primes, and U43112609 [2], is the currently largest known prime. Thus it is apparent that interesting events can be seen with primes in Lucas sequences. This paper undertakes trends in prime density in general Lucas sequences in two aspects - dierent values of a1; a2, and various values of P; Q. From this, several important observations are made before the search begins so as to restrict the search space. Consider various values of a1 = a; a2 = b (P = 1;Q = −1), such that the Lucas sequence is not the Fibonacci sequence. Then the sequence would be written as: M(a; b; 1; −1) : a; b; a + b; a + 2b; 2a + 3b; 3a + 5b; ::: (2) Compare this to the Fibonacci sequence: Fn = 1; 1; 2; 3; 5; 8::: We can see that sequence (2) is simply a combination of two Fibonacci sequences, such that: M(a; b; 1; −1) : an = a · Fn−2 + b · Fn−1 (3) This sequence will be dened as the general Fibonacci sequence, Gn(a; b) for a1 = a and a2 = b. Let us also dene Ln as sequence obtained from Gn(2; 1). Hence we make our rst important observation. If a and b are not coprime (they share a common divisor) then there is no hope in obtaining any primes (except for the initial values if they happen to be prime). Consider a common divisor, d, between a and b. Then since a = dr and b = ds for some r; s M(a; b; 1; −1) : an = a · Fn−2 + b · Fn−1 = d(r · Fn−2 + s · Fn−1): The exact same observation can be made for various values of P; Q. If we multiply the terms of the sequence by non-coprime values, then it is equal to multiplying the entire sequence by some number, which means that any resultant value has a divisor that is not itself. PRIME GENERATING LUCAS SEQUENCES 3 It is well known that prime numbers are quite random in their appearance. Let us dene Prime Density Distribution as the frequency of the prime count in the rst 1000 terms of the sequence divided by the total number of data points we have. Prime numbers grow at the rate of approximately n log n (where n is the nth prime), and so as our seeds and multipliers become big, we expect that the number of primes that we obtain within a 1000 terms of the sequence would likely decrease. Furthermore, the Prime Number Theorem (PNT) states that the probability of hitting a prime near some number N, is approximately 1=log N, and so the prime density would likely decrease as our multipliers and initial values become large. Methods. The data was collected through computational searches produced in the programming language Mathematica. As primality testing took up the bulk of this project, Mathematica was chosen for its eective prime testing function as well as its ability to analyze massive amounts of data. To determine the eect of dierent initial values on the prime density for Gn(a; b), all values Gn(a; b) (a; b; n < 1000) were tested for primes. The dierent seeds (a; b) were then ranked by the number of primes in the rst 1000 terms. However, as searching exhaustively through such a large space requires massive computational power, many optimizations were used to speed up the search. Due to the condition that only coprime pairs produced sequences with any primes, only coprime pairs of (a; b) were used. Furthermore, Gn(a; b), where a > b, produces a sequence that would already have been searched for some Gn(c; d), c < d, and so we set for the condition that a < b. Additionally, the issue of a sequence using seeds that are consecutive terms in some previously searched sequence was corrected for by pruning the list of results after the search. These simple restrictions easily reduced the search space by over 70%. Due to the recursive adding involved in the general Fibonacci sequence, there is always one even number for every two odd numbers. Using this fact, the search space was further reduced by testing only odd terms. Additionally, to speed up the explicit term calculations of Gn(a; b), a lookup table of Fibonacci numbers was used as opposed to any actual calculation. To search through dierent multipliers for Mn(a; b; P; −Q), all values of Mn(a; b; P; −Q) (0 < P; Q < 200; n < 1000) were tested for primes. The values of (P; Q) were restricted to under 200 as multipliers greater than this value required an inordinate amount of computation time due to their exponential growth. Again, the dierent multipliers (P; Q) were ranked based on number of primes in the rst 1000 terms and the requirement of coprimality was used to reduce the search space. However, as Mn(a; b; P; −Q) and Mn(a; b; −Q; P ) do not produce the same sequences, one cannot impose that P < Q. Additionally, as Mn(a; b; P; −Q) cannot be decomposed easily into Fibonacci sequences, the recursive denition of Mn was used to calculate the terms instead of using a lookup table. Then to gain some understanding of how initial values changed the eect of dierent multipliers, Fn(P; −Q) was investigated for one trial, and Ln(P; −Q) for another. Results. At an initial glance, the histogram of prime numbers within the rst 1000 terms show a slightly skewed normal distribution, but by using Mathematica's FindDistributionParameters function, it was deter- mined that it is not quite such a distribution. PRIME GENERATING LUCAS SEQUENCES 4 Figure 1: The probability density of prime numbers in the rst 1000 terms of the Fibonacci Sequence with changing initial seeds. The mean is 15.3 primes with a standard deviation of 4.9. Regardless, it can be seen that the distribution of prime numbers is quite random considering how closely their probability distribution resembles a Gaussian one. The most prime rich sequence was Gn(32; 341), which produced 46 primes, followed by Gn(179; 937) which produced 43 primes. These are intermediate sized values within the search, but after further analysis, it appears that the smaller seeds produce on average more primes. Figure 2: The probability density of prime numbers in the rst 1000 terms of the Lucas Sequence (Left) and Fibonacci Sequence (Right) with changing multipliers, which appear quite similar. The mean of the number of primes found in Lucas Sequences is 6.16 against Fibonacci Sequences with 6.07. From above, we see that the Lucas sequence shows a slightly higher average for primes, but overall they are very similar. Interestingly, the highest production of primes in the Lucas sequence came out to be the one with no multipliers at all Ln(1,1), and Ln(5,42), which produced 26 primes. They were followed by Ln(3,10) and Ln(11,6) with 24 primes. The Fibonacci sequence showed similar trends with low multipliers but producing fewer primes, with Fn(6,125) and Fn(11,90) producing only 23 primes. Thus, it can be seen that changing the initial values of the sequences aects the prime production much more, and produces many more primes than changing the multipliers. Figure 3: The frequency of primes in the smallest 10% of our seed search space (left) and the biggest 10% (right). Means of smallest seeds found to be 16.8 compared to the 10% biggest seeds found to be 14.7. See appendix for determination of size of seeds for the histograms. From the 106172 data points collected by varying the initial values of Gn, it can be seen that the smaller seeds belonging in the lower 10% produce 1 prime higher on average than the larger seeds.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    7 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us