Perrin Pseudoprime
   HOME

TheInfoList



OR:

In mathematics, the Perrin numbers are a doubly infinite constant-recursive
integer sequence In mathematics, an integer sequence is a sequence (i.e., an ordered list) of integers. An integer sequence may be specified ''explicitly'' by giving a formula for its ''n''th term, or ''implicitly'' by giving a relationship between its terms. For ...
with characteristic equation . The Perrin numbers, named after the French engineer , bear the same relationship to the
Padovan sequence In number theory, the Padovan sequence is the integer sequence, sequence of integers ''P''(''n'') defined. by the initial values P(0) = P(1) = P(2) = 1, and the recurrence relation P(n) = P(n-2)+P(n-3). The first few values of ''P''(''n'') are ...
as the Lucas numbers do to the
Fibonacci sequence In mathematics, the Fibonacci sequence is a Integer sequence, sequence in which each element is the sum of the two elements that precede it. Numbers that are part of the Fibonacci sequence are known as Fibonacci numbers, commonly denoted . Many w ...
.


Definition

The Perrin numbers are defined by the
recurrence relation In mathematics, a recurrence relation is an equation according to which the nth term of a sequence of numbers is equal to some combination of the previous terms. Often, only k previous terms of the sequence appear in the equation, for a parameter ...
:\begin P(0)&=3, \\ P(1)&=0, \\ P(2)&=2, \\ P(n)&=P(n-2) +P(n-3) \mboxn>2, \end and the reverse :P(n) =P(n+3) -P(n+1) \mboxn<0. The first few terms in both directions are Perrin numbers can be expressed as sums of the three initial terms :\begin n & P(n) & P(-n) \\ \hline 0 & P(0) & ... \\ 1 & P(1) & P(2) -P(0) \\ 2 & P(2) & -P(2) +P(1) +P(0) \\ 3 & P(1) +P(0) & P(2) -P(1) \\ 4 & P(2) +P(1) & P(1) -P(0) \\ 5 & P(2) +P(1) +P(0) & -P(2) +2P(0) \\ 6 & P(2) +2P(1) +P(0) & 2P(2) -P(1) -2P(0) \\ 7 & 2P(2) +2P(1) +P(0) & -2P(2) +2P(1) +P(0) \\ 8 & 2P(2) +3P(1) +2P(0) & P(2) -2P(1) +P(0) \end The first fourteen prime Perrin numbers are


History

In 1876 the sequence and its equation were initially mentioned by
Édouard Lucas __NOTOC__ François Édouard Anatole Lucas (; 4 April 1842 – 3 October 1891) was a French mathematician. Lucas is known for his study of the Fibonacci sequence. The related Lucas sequences and Lucas numbers are named after him. Biography Luc ...
, who noted that the index ''n'' divides term if ''n'' is prime. In 1899 asked if there were any counterexamples to this property. The first divisible by composite index ''n'' was found only in 1982 by William Adams and
Daniel Shanks Daniel Charles Shanks (January 17, 1917 – September 6, 1996) was an American mathematician who worked primarily in numerical analysis and number theory. He was the first person to compute π to 100,000 decimal places. Life and education Shan ...
. They presented a detailed investigation of the sequence, with a sequel appearing four years later.


Properties

The Perrin sequence also satisfies the recurrence relation P(n) =P(n-1) +P(n-5). Starting from this and the defining recurrence, one can create an infinite number of further relations, for example P(n) =P(n-3) +P(n-4) +P(n-5). The
generating function In mathematics, a generating function is a representation of an infinite sequence of numbers as the coefficients of a formal power series. Generating functions are often expressed in closed form (rather than as a series), by some expression invo ...
of the Perrin sequence is : \frac =\sum_^ P(n)\,x^n The sequence is related to sums of
binomial coefficient In mathematics, the binomial coefficients are the positive integers that occur as coefficients in the binomial theorem. Commonly, a binomial coefficient is indexed by a pair of integers and is written \tbinom. It is the coefficient of the t ...
s by : P(n) =n \times \sum_^ \binom /k, P(-n) =n \times \sum_^ (-1)^ \binom /(n -2k). Perrin numbers can be expressed in terms of partial sums :\begin P(n+5) -2&=\sum_^ P(k) \\ P(2n+3)&=\sum_^ P(2k) \\ 5 -P(4-n)&=\sum_^ P(-k) \\ 3 -P(1-2n)&=\sum_^ P(-2k). \end The Perrin numbers are obtained as integral powers of the
matrix Matrix (: matrices or matrixes) or MATRIX may refer to: Science and mathematics * Matrix (mathematics), a rectangular array of numbers, symbols or expressions * Matrix (logic), part of a formula in prenex normal form * Matrix (biology), the m ...
:\begin 0 & 1 & 0 \\ 0 & 0 & 1 \\ 1 & 1 & 0 \end^ \begin 3 \\ 0 \\ 2 \end = \begin P(n) \\ P(n+1) \\ P(n+2) \end, and its
inverse Inverse or invert may refer to: Science and mathematics * Inverse (logic), a type of conditional sentence which is an immediate inference made from another conditional sentence * Additive inverse, the inverse of a number that, when added to the ...
:\begin -1 & 0 & 1 \\ 1 & 0 & 0 \\ 0 & 1 & 0 \end^ \begin 3 \\ 0 \\ 2 \end = \begin P(-n) \\ P(1-n) \\ P(2-n) \end. The Perrin analogue of the Simson identity for
Fibonacci number In mathematics, the Fibonacci sequence is a Integer sequence, sequence in which each element is the sum of the two elements that precede it. Numbers that are part of the Fibonacci sequence are known as Fibonacci numbers, commonly denoted . Many w ...
s is given by the determinant :\begin P(n+2) & P(n+1) & P(n) \\ P(n+1) & P(n) & P(n-1) \\ P(n) & P(n-1) & P(n-2) \end =-23. The number of different
maximal independent set In graph theory, a maximal independent set (MIS) or maximal stable set is an Independent set (graph theory), independent set that is not a subset of any other independent set. In other words, there is no Vertex (graph theory), vertex outside th ...
s in an ''n''-vertex
cycle graph In graph theory, a cycle graph or circular graph is a graph that consists of a single cycle, or in other words, some number of vertices (at least 3, if the graph is simple) connected in a closed chain. The cycle graph with vertices is called ...
is counted by the ''n''th Perrin number for .


Binet formula

The
solution Solution may refer to: * Solution (chemistry), a mixture where one substance is dissolved in another * Solution (equation), in mathematics ** Numerical solution, in numerical analysis, approximate solutions within specified error bounds * Solu ...
of the recurrence P(n) =P(n-2) +P(n-3) can be written in terms of the
roots A root is the part of a plant, generally underground, that anchors the plant body, and absorbs and stores water and nutrients. Root or roots may also refer to: Art, entertainment, and media * ''The Root'' (magazine), an online magazine focusin ...
of characteristic equation x^3 -x -1=0. If the three solutions are
real Real may refer to: Currencies * Argentine real * Brazilian real (R$) * Central American Republic real * Mexican real * Portuguese real * Spanish real * Spanish colonial real Nature and science * Reality, the state of things as they exist, rathe ...
root (with approximate value 1.324718 and known as the
plastic ratio In mathematics, the plastic ratio is a geometrical aspect ratio, proportion, given by the unique real polynomial root, solution of the equation Its decimal expansion begins as . The adjective ''plastic'' does not refer to Plastic, the artifici ...
) and
complex conjugate In mathematics, the complex conjugate of a complex number is the number with an equal real part and an imaginary part equal in magnitude but opposite in sign. That is, if a and b are real numbers, then the complex conjugate of a + bi is a - ...
roots and , the Perrin numbers can be computed with the
Binet formula In mathematics, the Fibonacci sequence is a Integer sequence, sequence in which each element is the sum of the two elements that precede it. Numbers that are part of the Fibonacci sequence are known as Fibonacci numbers, commonly denoted . Many w ...
P(n) =\alpha^ +\beta^ +\gamma^, which also holds for negative ''n''. The
polar form In mathematics, a complex number is an element of a number system that extends the real numbers with a specific element denoted , called the imaginary unit and satisfying the equation i^= -1; every complex number can be expressed in the form ...
is P(n) =\alpha^ +2\cos(n\,\theta) \sqrt, with \theta =\arccos(-\sqrt /2). Since \lim_ \alpha^ =0, the formula reduces to either the first or the second term successively for large positive or negative ''n'', and numbers with negative subscripts oscillate. Provided ''α'' is computed to sufficient precision, these formulas can be used to calculate Perrin numbers for large ''n''. Expanding the identity P^(n) =( \alpha^ +\beta^ +\gamma^ )^ gives the important index-doubling rule P(2n) =P^(n) -2P(-n), by which the forward and reverse parts of the sequence are linked.


Prime index ''p'' divides ''P(p)''

If the characteristic equation of the sequence is written as f(x) =x^ -\sigma_1 x^ +\sigma_2 x -\sigma_3 then the coefficients can be expressed in terms of roots \alpha,\beta,\gamma with
Vieta's formulas In mathematics, Vieta's formulas relate the coefficients of a polynomial to sums and products of its roots. They are named after François Viète (1540-1603), more commonly referred to by the Latinised form of his name, "Franciscus Vieta." Basi ...
: :\begin \sigma_1 &=\alpha +\beta +\gamma &&= 0\\ \sigma_2 &=\alpha\beta +\alpha\gamma +\beta\gamma &&=-1\\ \sigma_3 &=\alpha\beta\gamma &&= 1. \end These integer valued functions are the
elementary symmetric polynomials Elementary may refer to: Arts, entertainment, and media Music * Elementary (Cindy Morgan album), ''Elementary'' (Cindy Morgan album), 2001 * Elementary (The End album), ''Elementary'' (The End album), 2007 * ''Elementary'', a Melvin "Wah-Wah Watso ...
in \alpha,\beta,\gamma. * The fundamental theorem on symmetric polynomials states that every symmetric polynomial in the complex roots of monic can be represented as another polynomial function in the integer coefficients of * The analogue of
Lucas's theorem In number theory, Lucas's theorem expresses the remainder of division of the binomial coefficient \tbinom by a prime number ''p'' in terms of the base ''p'' expansions of the integers ''m'' and ''n''. Lucas's theorem first appeared in 1878 in pa ...
for
multinomial coefficients In mathematics, the multinomial theorem describes how to expand a power of a sum in terms of powers of the terms in that sum. It is the generalization of the binomial theorem from binomials to multinomials. Theorem For any positive integer an ...
\frac says that if then \binom is divisible by prime Given integers and : (a +b +c)^n = \sum_ \binom a^i b^j c^k. Rearrange into symmetric
monomial In mathematics, a monomial is, roughly speaking, a polynomial which has only one term. Two definitions of a monomial may be encountered: # A monomial, also called a power product or primitive monomial, is a product of powers of variables with n ...
summands, permuting exponents : (a +b +c)^n - (a^n +b^n +c^n) = \sum_ \binom \sum_ a^i b^j c^k. Substitute prime for power and complex roots \alpha,\beta,\gamma for integers and compute representations in terms of \sigma_1,\sigma_2,\sigma_3 for all symmetric polynomial functions. For example, ( \alpha +\beta +\gamma )^ is \sigma_1^ =0 and the power sum \alpha^ +\beta^ +\gamma^ =P(p) can be expressed in the coefficients with Newton's recursive scheme. It follows that the identity has integer terms and both sides divisible by prime To show that prime divides in the reverse sequence, the characteristic equation has to be
reflected Reflection is the change in direction of a wavefront at an interface between two different media so that the wavefront returns into the medium from which it originated. Common examples include the reflection of light, sound and water waves. The ...
. The roots are then \alpha^,\beta^,\gamma^, the coefficients \sigma_1 =-1, \sigma_2 =0, \sigma_3 =1, and the same reasoning applies.


Perrin primality test

Query 1484.  The curious proposition of Chinese origin which is the subject of query 1401 would provide, if it is true, a more practical criterium than
Wilson's theorem In algebra and number theory, Wilson's theorem states that a natural number ''n'' > 1 is a prime number if and only if the product of all the positive integers less than ''n'' is one less than a multiple of ''n''. That is (using the notations of ...
for verifying whether a given number is prime or not; it would suffice to calculate the residues with respect to of successive terms of the recurrence sequence with initial values
I have found another recurrence sequence that seems to possess the same property; it is the one whose general term is with initial values It is easy to demonstrate that is divisible by , if is prime; I have verified, up to fairly high values of , that in the opposite case it is not; but it would be interesting to know if this is really so, especially since the sequence gives much less rapidly increasing numbers than the sequence (for , for example, one finds ), which leads to simpler calculations when is a large number.
The same proof, applicable to one of the sequences, will undoubtedly bear upon the other, if the stated property is true for both: it is only a matter of discovering it.
The Perrin sequence has the Fermat property: if is
prime A prime number (or a prime) is a natural number greater than 1 that is not a product of two smaller natural numbers. A natural number greater than 1 that is not prime is called a composite number. For example, 5 is prime because the only ways ...
, P(p) \equiv P(1) \equiv 0\pmod. However, the converse is not true: some
composite Composite or compositing may refer to: Materials * Composite material, a material that is made from several different substances ** Metal matrix composite, composed of metal and other parts ** Cermet, a composite of ceramic and metallic material ...
may still divide A number with this property is called a Perrin
pseudoprime A pseudoprime is a probable prime (an integer that shares a property common to all prime numbers) that is not actually prime. Pseudoprimes are classified according to which property of primes they satisfy. Some sources use the term pseudoprime to ...
. The question of the existence of Perrin pseudoprimes was considered by Malo and Jarden, but none were known until Adams and Shanks found the smallest one, 271441 = 521^2 (the number has 33150 decimal digits). Jon Grantham later proved that there are infinitely many Perrin pseudoprimes. The seventeen Perrin pseudoprimes below are 271441, 904631, 16532714, 24658561, 27422714, 27664033, 46672291, 102690901, 130944133, 196075949, 214038533, 517697641, 545670533, 801123451, 855073301, 903136901, 970355431. Adams and Shanks noted that primes also satisfy the congruence P(-p)\equiv P(-1)\pmod. Composites for which both properties hold are called restricted Perrin pseudoprimes. There are only nine such numbers below . While Perrin pseudoprimes are rare, they overlap with
Fermat pseudoprime In number theory, the Fermat pseudoprimes make up the most important class of pseudoprimes that come from Fermat's little theorem. Definition Fermat's little theorem states that if p is prime and a is coprime to p, then a^-1 is divisible by p. F ...
s. Of the above seventeen numbers, four are base Fermatians as well. In contrast, the
Lucas pseudoprime Lucas pseudoprimes and Fibonacci pseudoprimes are composite integers that pass certain tests which all primes and very few composite numbers pass: in this case, criteria relative to some Lucas sequence. Baillie-Wagstaff-Lucas pseudoprimes Bai ...
s are anti-correlated. Presumably, combining the Perrin and Lucas tests should make a
primality test A primality test is an algorithm for determining whether an input number is prime. Among other fields of mathematics, it is used for cryptography. Unlike integer factorization, primality tests do not generally give prime factors, only stating wheth ...
as strong as the reliable BPSW test which has no known pseudoprimes – though at higher computational cost.


Pseudocode

The 1982 Adams and Shanks O(\log n) Perrin primality test. Two integer arrays u(3) and v(3) are initialized to the lowest terms of the Perrin sequence, with positive indices in u( ) and negative indices in v( ). The main double-and-add loop, originally devised to run on an
HP-41C The HP-41C series are programmable, expandable, continuous memory handheld RPN calculators made by Hewlett-Packard from 1979 to 1990. The original model, HP-41C, was the first of its kind to offer alphanumeric display capabilities. Later came ...
pocket calculator, computes and the reverse at the cost of six modular squarings for each bit of . The subscripts of the Perrin numbers are doubled using the identity . The resulting gaps between and are closed by applying the defining relation . ''Initial values'' let ''int'' u(0):= 3, u(1):= 0, let ''int'' v(0):= 3, v(1):=−1, ''Test odd positive number n'' input ''int'' n set ''int'' h:= most significant bit of n for k:= h − 1 downto 0 ''Double the indices of'' ''the six Perrin numbers.'' for i = 0, 1, 2 temp:= u(i)^2 − 2v(i) v(i):= v(i)^2 − 2u(i) u(i):= temp endfor ''Copy P(2t + 2) and '' ''to the array ends and use'' ''in the if-statement below.'' u(3):= u(2) v(3):= v(2) ''Overwrite P(2t ± 2) with '' temp:= u(2) − u(1) u(2):= u(0) + temp u(0):= temp ''Overwrite P(−2t ± 2) with '' temp:= v(0) − v(1) v(0):= v(2) + temp v(2):= temp if n has bit k set then ''Increase the indices of'' ''both Perrin triples by 1.'' for i = 0, 1, 2 u(i):= u(i + 1) v(i):= v(i + 1) endfor endif endfor ''Result'' print v(2), v(1), v(0) print u(0), u(1), u(2) Successively and . If and then ''n'' is a
probable prime In number theory, a probable prime (PRP) is an integer that satisfies a specific condition that is satisfied by all prime numbers, but which is not satisfied by most composite numbers. Different types of probable primes have different specific co ...
, that is: actually prime or a restricted Perrin pseudoprime. Shanks ''et al.'' observed that for all restricted pseudoprimes they found, the final state of the above six registers (the "signature" of ''n'') equals the initial state 1,−1,3, 3,0,2. The same occurs with of all primes, so the two sets cannot be distinguished on the strength of this test alone. For those cases, they recommend to also use the Narayana-Lucas sister sequence with recurrence relation and initial values u(0):= 3, u(1):= 1, u(2):= 1 v(0):= 3, v(1):= 0, v(2):=−2 The same doubling rule applies and the formulas for filling the gaps are temp:= u(0) + u(1) u(0):= u(2) − temp u(2):= temp temp:= v(2) + v(1) v(2):= v(0) − temp v(0):= temp Here, ''n'' is a probable prime if and . Kurtz ''et al.'' found no overlap between the odd pseudoprimes for the two sequences below and supposed that 2,277,740,968,903 = 1067179 ∙ 2134357 is the smallest composite number to pass both tests. If the third-order Pell-Lucas recurrence is used as well, this bound will be pushed up to 4,057,052,731,496,380,171 = 1424263447 ∙ 2848526893. Additionally, roots of the doubling rule-congruence x^2 -2x \equiv 3 =P(0) \pmod\, other than or expose composite numbers, like non-trivial square roots of in the Miller-Rabin test. This reduces the number of restricted pseudoprimes for each sequence by roughly one-third and is especially efficient in detecting
Carmichael number In number theory, a Carmichael number is a composite number which in modular arithmetic satisfies the congruence relation: : b^n\equiv b\pmod for all integers . The relation may also be expressed in the form: : b^\equiv 1\pmod for all integers b ...
s. The least strong restricted Perrin pseudoprime is 46672291 and the above two bounds expand to successively 173,536,465,910,671 and 79,720,990,309,209,574,421.


Notes


References

* * * * * * * * * * * * *


External links


Jacobsen, Dana (2016). "Perrin Primality Tests".


* *


Turk, Richard (2014). "The Perrin Chalkboard".
{{Classes of natural numbers Recurrence relations Integer sequences Primality tests