Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Perrin number

From Wikipedia, the free encyclopedia
(Redirected fromPerrin prime)
Number sequence 3,0,2,3,2,5,5,7,10,...
Spiral ofequilateral triangles with side lengths equal to Perrin numbers.

Inmathematics, thePerrin numbers are a doubly infiniteconstant-recursiveinteger sequence withcharacteristic equationx3 =x + 1. The Perrin numbers, named after the French engineerRaoul Perrin [fr], bear the same relationship to thePadovan sequence as theLucas numbers do to theFibonacci sequence.

Definition

[edit]

The Perrin numbers are defined by therecurrence relation

P(0)=3,P(1)=0,P(2)=2,P(n)=P(n2)+P(n3) for n>2,{\displaystyle {\begin{aligned}P(0)&=3,\\P(1)&=0,\\P(2)&=2,\\P(n)&=P(n-2)+P(n-3){\mbox{ for }}n>2,\end{aligned}}}

and the reverse

P(n)=P(n+3)P(n+1) for n<0.{\displaystyle P(n)=P(n+3)-P(n+1){\mbox{ for }}n<0.}

The first few terms in both directions are

n01234567891011121314151617
P(n)30232557101217222939516890119...[1]
P(−n)...−112−34−2−15−76−1−612−1375−18...[2]

Perrin numbers can be expressed as sums of the three initial terms

nP(n)P(n)0P(0)...1P(1)P(2)P(0)2P(2)P(2)+P(1)+P(0)3P(1)+P(0)P(2)P(1)4P(2)+P(1)P(1)P(0)5P(2)+P(1)+P(0)P(2)+2P(0)6P(2)+2P(1)+P(0)2P(2)P(1)2P(0)72P(2)+2P(1)+P(0)2P(2)+2P(1)+P(0)82P(2)+3P(1)+2P(0)P(2)2P(1)+P(0){\displaystyle {\begin{array}{c|c|c}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{array}}}

The first fourteen prime Perrin numbers are

n2345671012202124343875...[3]
P(n)232557172927736785314197437211442968193...[4]

History

[edit]

In 1876 the sequence and its equation were initially mentioned byÉdouard Lucas, who noted that the indexn divides termP(n) ifn is prime.[5] In 1899Raoul Perrin [fr] asked if there were any counterexamples to this property.[6] The firstP(n) divisible by composite indexn was found only in 1982 by William Adams andDaniel Shanks.[7] They presented a detailed investigation of the sequence, with a sequel appearing four years later.[8]

Properties

[edit]
A Perrin microcosm: theescape time algorithm is applied to theNewton map of theentirePerrin functionF(z) aroundcritical point z = 1.225432 with viewport width 0.05320. Thebasins of attraction emanating from the centre correspond to the infinite number of real (left) and complex roots (right)F(z) = 0.

The Perrin sequence also satisfies the recurrence relationP(n)=P(n1)+P(n5).{\displaystyle 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 exampleP(n)=P(n3)+P(n4)+P(n5).{\displaystyle P(n)=P(n-3)+P(n-4)+P(n-5).}

Thegenerating function of the Perrin sequence is

3x21x2x3=n=0P(n)xn{\displaystyle {\frac {3-x^{2}}{1-x^{2}-x^{3}}}=\sum _{n=0}^{\infty }P(n)\,x^{n}}

The sequence is related to sums ofbinomial coefficients by

P(n)=n×k=(n+2)/3n/2(kn2k)/k,{\displaystyle P(n)=n\times \sum _{k=\lfloor (n+2)/3\rfloor }^{\lfloor n/2\rfloor }{\binom {k}{n-2k}}/k,}[1]

P(n)=n×k=0n/3(1)nk(n2kk)/(n2k).{\displaystyle P(-n)=n\times \sum _{k=0}^{\lfloor n/3\rfloor }(-1)^{n-k}{\binom {n-2k}{k}}/(n-2k).}

Perrin numbers can be expressed in terms of partial sums

P(n+5)2=k=0nP(k)P(2n+3)=k=0nP(2k)5P(4n)=k=0nP(k)3P(12n)=k=0nP(2k).{\displaystyle {\begin{aligned}P(n+5)-2&=\sum _{k=0}^{n}P(k)\\P(2n+3)&=\sum _{k=0}^{n}P(2k)\\5-P(4-n)&=\sum _{k=0}^{n}P(-k)\\3-P(1-2n)&=\sum _{k=0}^{n}P(-2k).\end{aligned}}}

The Perrin numbers are obtained as integral powersn ≥ 0 of thematrix

(010001110)n(302)=(P(n)P(n+1)P(n+2)),{\displaystyle {\begin{pmatrix}0&1&0\\0&0&1\\1&1&0\end{pmatrix}}^{n}{\begin{pmatrix}3\\0\\2\end{pmatrix}}={\begin{pmatrix}P(n)\\P(n+1)\\P(n+2)\end{pmatrix}},}

and itsinverse

(101100010)n(302)=(P(n)P(1n)P(2n)).{\displaystyle {\begin{pmatrix}-1&0&1\\1&0&0\\0&1&0\end{pmatrix}}^{n}{\begin{pmatrix}3\\0\\2\end{pmatrix}}={\begin{pmatrix}P(-n)\\P(1-n)\\P(2-n)\end{pmatrix}}.}

The Perrin analogue of theSimson identity forFibonacci numbers is given by the determinant

|P(n+2)P(n+1)P(n)P(n+1)P(n)P(n1)P(n)P(n1)P(n2)|=23.{\displaystyle {\begin{vmatrix}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{vmatrix}}=-23.}

The number of differentmaximal independent sets in ann-vertexcycle graph is counted by thenth Perrin number forn ≥ 2.[9]

Binet formula

[edit]
The Perrin function extends the sequence to real numbers.

Thesolution of the recurrenceP(n)=P(n2)+P(n3){\displaystyle P(n)=P(n-2)+P(n-3)} can be written in terms of theroots ofcharacteristic equationx3x1=0{\displaystyle x^{3}-x-1=0}. If the three solutions arereal rootα{\displaystyle \alpha } (with approximate value 1.324718 and known as theplastic ratio) andcomplex conjugate rootsβ{\displaystyle \beta } andγ{\displaystyle \gamma }, the Perrin numbers can be computed with theBinet formulaP(n)=αn+βn+γn,{\displaystyle P(n)=\alpha ^{n}+\beta ^{n}+\gamma ^{n},} which also holds for negativen.

Thepolar form isP(n)=αn+2cos(nθ)αn,{\displaystyle P(n)=\alpha ^{n}+2\cos(n\,\theta ){\sqrt {\alpha ^{-n}}},} withθ=arccos(α3/2).{\displaystyle \theta =\arccos(-{\sqrt {\alpha ^{3}}}/2).} Sincelimnαn=0,{\displaystyle \lim _{n\to \infty }\alpha ^{-n}=0,} the formula reduces to either the first or the second term successively for large positive or negativen, and numbers with negative subscripts oscillate. Providedα is computed to sufficient precision, these formulas can be used to calculate Perrin numbers for largen.

Expanding the identityP2(n)=(αn+βn+γn)2{\displaystyle P^{2}(n)=(\alpha ^{n}+\beta ^{n}+\gamma ^{n})^{2}} gives the important index-doubling ruleP(2n)=P2(n)2P(n),{\displaystyle P(2n)=P^{2}(n)-2P(-n),} by which the forward and reverse parts of the sequence are linked.

Prime indexp dividesP(p)

[edit]

If the characteristic equation of the sequence is written asf(x)=x3σ1x2+σ2xσ3{\displaystyle f(x)=x^{3}-\sigma _{1}x^{2}+\sigma _{2}x-\sigma _{3}} then the coefficientsσk{\displaystyle \sigma _{k}} can be expressed in terms of rootsα,β,γ{\displaystyle \alpha ,\beta ,\gamma } withVieta's formulas:

σ1=α+β+γ=0σ2=αβ+αγ+βγ=1σ3=αβγ=1.{\displaystyle {\begin{alignedat}{3}\sigma _{1}&=\alpha +\beta +\gamma &&=0\\\sigma _{2}&=\alpha \beta +\alpha \gamma +\beta \gamma &&=-1\\\sigma _{3}&=\alpha \beta \gamma &&=1.\end{alignedat}}}

These integer valued functions are theelementary symmetric polynomials inα,β,γ.{\displaystyle \alpha ,\beta ,\gamma .}

Given integersa,b,c{\displaystyle a,b,c} andn>0{\displaystyle n>0},

(a+b+c)n=i+j+k=n(ni,j,k)aibjck.{\displaystyle (a+b+c)^{n}=\sum _{i+j+k=n}{\binom {n}{i,j,k}}a^{i}b^{j}c^{k}.}

Rearrange into symmetricmonomial summands,permuting exponentsi, j, k:

(a+b+c)n(an+bn+cn)={\displaystyle (a+b+c)^{n}-(a^{n}+b^{n}+c^{n})=}ijk<ni+j+k=n(ni,j,k)π(i,j,k)aibjck.{\displaystyle \sum _{\begin{aligned}i\leq j\leq k&<n\\i+j+k&=n\end{aligned}}{\binom {n}{i,j,k}}\sum _{\pi (i,j,k)}a^{i}b^{j}c^{k}.}

Substitute primep{\displaystyle p} for powern{\displaystyle n} and complex rootsα,β,γ{\displaystyle \alpha ,\beta ,\gamma } for integersa,b,c{\displaystyle a,b,c} and compute representations in terms ofσ1,σ2,σ3{\displaystyle \sigma _{1},\sigma _{2},\sigma _{3}} for all symmetric polynomial functions. For example,(α+β+γ)p{\displaystyle (\alpha +\beta +\gamma )^{p}} isσ1p=0{\displaystyle \sigma _{1}^{p}=0} and thepower sumαp+βp+γp=P(p){\displaystyle \alpha ^{p}+\beta ^{p}+\gamma ^{p}=P(p)} can be expressed in the coefficientsσk{\displaystyle \sigma _{k}} withNewton's recursive scheme. It follows that the identity has integer terms and both sides divisible by primep.{\displaystyle p.}

To show that primep{\displaystyle p} dividesP(p)+1{\displaystyle P(-p)+1} in the reverse sequence, the characteristic equation has to bereflected. The roots are thenα1,β1,γ1,{\displaystyle \alpha ^{-1},\beta ^{-1},\gamma ^{-1},} the coefficientsσ1=1,σ2=0,σ3=1,{\displaystyle \sigma _{1}=-1,\sigma _{2}=0,\sigma _{3}=1,} and the same reasoning applies.

Perrin primality test

[edit]

Query 1484. The curiousproposition of Chinese origin which is the subject of query 1401[10] would provide, if it is true, a more practical criterium thanWilson's theorem for verifying whether a given number m is prime or not; it would suffice to calculate the residues with respect to m of successive terms of the recurrence sequence
un = 3un−1 − 2un−2 with initial values u0 = −1, u1 = 0.[11]
I have found another recurrence sequence that seems to possess the same property; it is the one whose general term is
vn = vn−2 + vn−3 with initial values v0 = 3, v1 = 0, v2 = 2. It is easy to demonstrate that vn is divisible by n, if n is prime; I have verified, up to fairly high values of n, that in the opposite case it is not; but it would be interesting to know if this is really so, especially since the sequence vn gives much less rapidly increasing numbers than the sequence un (for n = 17, for example, one finds un = 131070, vn = 119), which leads to simpler calculations when n 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.[12]

The Perrin sequence has theFermat property: ifp isprime,P(p) ≡ P(1) ≡ 0 (mod p). However, theconverse is not true: somecompositen may still divideP(n). A number with this property is called a Perrinpseudoprime.

The question of the existence of Perrin pseudoprimes was considered by Malo and Jarden,[13] but none were known until Adams and Shanks found the smallest one, 271441 = 5212 (the numberP(271441) has 33150 decimal digits).[14] Jon Grantham later proved that there are infinitely many Perrin pseudoprimes.[15]

The seventeen Perrin pseudoprimes below109 are

271441, 904631, 16532714, 24658561, 27422714, 27664033, 46672291, 102690901, 130944133, 196075949, 214038533, 517697641, 545670533, 801123451, 855073301, 903136901, 970355431.[16]

Adams and Shanks noted that primes also satisfy the congruenceP(−p) ≡ P(−1) ≡ −1 (mod p). Composites for which both properties hold are called restricted Perrin pseudoprimes. There are only nine such numbers below109.[17][18][19]

While Perrin pseudoprimes are rare, they overlap withFermat pseudoprimes. Of the above seventeen numbers, four are base 2 Fermatians as well. In contrast, theLucas pseudoprimes are anti-correlated.[20] Presumably, combining the Perrin and Lucas tests should make aprimality test as strong as the reliableBPSW test which has no known pseudoprimes – though at higher computational cost.

Pseudocode

[edit]

The 1982 Adams and ShanksO(log n) Perrin primality test.[21]

Two integer arrays u(3) and v(3) are initialized to the lowest terms of the Perrin sequence, with positive indicest = 0, 1, 2 in u( ) and negative indicest = 0,−1,−2 in v( ).

The maindouble-and-add loop, originally devised to run on anHP-41C pocket calculator, computesP(n) mod n and the reverseP(−n) mod n at the cost of six modular squarings for each bit ofn.

The subscripts of the Perrin numbers are doubled using the identityP(2t) = P2(t) − 2P(−t). The resulting gaps betweenP(±2t) andP(±2t ± 2) are closed by applying the defining relationP(t) = P(t − 2) + P(t − 3).

Initial valuesletint u(0):= 3, u(1):= 0,u(2):= 2letint v(0):= 3, v(1):=−1,v(2):= 1Test odd positive number ninputint nsetint h:= most significant bit of nfor k:= h − 1downto 0Double the indices ofthe six Perrin numbers.for i = 0, 1, 2    temp:= u(i)^2 − 2v(i)(mod n)    v(i):= v(i)^2 − 2u(i)(mod n)    u(i):= tempendforCopy P(2t + 2) andP(−2t − 2)to the array ends and usein the if-statement below.  u(3):= u(2)  v(3):= v(2)Overwrite P(2t ± 2) withP(2t ± 1)  temp:= u(2) − u(1)  u(2):= u(0) + temp  u(0):= tempOverwrite P(−2t ± 2) withP(−2t ± 1)  temp:= v(0) − v(1)  v(0):= v(2) + temp  v(2):= tempif n has bit k setthenIncrease the indices ofboth Perrin triples by 1.for i = 0, 1, 2      u(i):= u(i + 1)      v(i):= v(i + 1)endforendifendforResultprint v(2), v(1), v(0)print u(0), u(1), u(2)

SuccessivelyP(−n − 1), P(−n), P(−n + 1) andP(n − 1), P(n), P(n + 1) (mod n).

IfP(−n) = −1 andP(n) = 0 thenn is aprobable prime, that is: actually prime or a restricted Perrin pseudoprime.

Shankset al. observed that for all restricted pseudoprimes they found, the final state of the above six registers (the "signature" ofn) equals the initial state 1,−1,3, 3,0,2.[22] The same occurs with≈ 1/6 of all primes, so the two sets cannot be distinguished on the strength of this test alone.[23] For those cases, they recommend to also use theNarayana-Lucas sister sequence with recurrence relationA(n) = A(n − 1) + A(n − 3) and initial values

u(0):= 3, u(1):= 1, u(2):= 1v(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) − tempu(2):= temp     temp:= v(2) + v(1)v(2):= v(0) − tempv(0):= temp

Here,n is a probable prime ifA(−n) = 0 andA(n) = 1.

Kurtzet al. found no overlap between the odd pseudoprimes for the two sequences below50∙109 and supposed that 2,277,740,968,903 = 1067179 ∙ 2134357 is the smallest composite number to pass both tests.[24]

If thethird-order Pell-Lucas recurrenceA(n) = 2A(n − 1) + A(n − 3) is used as well, this bound will be pushed up to 4,057,052,731,496,380,171 = 1424263447 ∙ 2848526893.[25]

Additionally, roots of the doubling rule-congruencex22x3=P(0)(modn){\displaystyle x^{2}-2x\equiv 3=P(0){\pmod {n}}\,} other than−1 or3 expose composite numbers, like non-trivial square roots of1 in theMiller-Rabin test.[26] This reduces the number of restricted pseudoprimes for each sequence by roughly one-third and is especially efficient in detectingCarmichael numbers.[27]

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.[28]

Notes

[edit]
  1. ^abSloane, N. J. A. (ed.)."Sequence A001608 (Perrin sequence (or Ondrej Such sequence): a(n) = a(n-2) + a(n-3) with a(0) = 3, a(1) = 0, a(2) = 2)".TheOn-Line Encyclopedia of Integer Sequences. OEIS Foundation.
  2. ^Sloane, N. J. A. (ed.)."Sequence A078712 (Series expansion of (-3 - 2*x)/(1 + x - x^3) in powers of x)".TheOn-Line Encyclopedia of Integer Sequences. OEIS Foundation.
  3. ^Sloane, N. J. A. (ed.)."Sequence A112881 (Indices of prime Perrin numbers; values of n such that A001608(n) is prime)".TheOn-Line Encyclopedia of Integer Sequences. OEIS Foundation.
  4. ^Sloane, N. J. A. (ed.)."Sequence A074788 (Prime numbers in the Perrin sequence b(n+1) = b(n-1) + b(n-2) with initial values b(1)=3, b(2)=0, b(3)=2)".TheOn-Line Encyclopedia of Integer Sequences. OEIS Foundation.
  5. ^Lucas (1878)
  6. ^Perrin (1899)
  7. ^Adams & Shanks (1982)
  8. ^Kurtz, Shanks & Williams (1986)
  9. ^Füredi (1987)
  10. ^Tarry (1898)
  11. ^Sloane, N. J. A. (ed.)."Sequence A000918 (a(n) = 2^n - 2)".TheOn-Line Encyclopedia of Integer Sequences. OEIS Foundation.
  12. ^Perrin (1899) translated from the French
  13. ^Malo (1900),Jarden (1966)
  14. ^Adams & Shanks (1982, p. 255)
  15. ^Grantham (2010),Stephan (2020)
  16. ^Sloane, N. J. A. (ed.)."Sequence A013998 (Unrestricted Perrin pseudoprimes)".TheOn-Line Encyclopedia of Integer Sequences. OEIS Foundation.
  17. ^Sloane, N. J. A. (ed.)."Sequence A018187 (Restricted Perrin pseudoprimes)".TheOn-Line Encyclopedia of Integer Sequences. OEIS Foundation.
  18. ^Sloane, N. J. A. (ed.)."Sequence A275612 (Restricted Perrin pseudoprimes (Adams and Shanks definition))".TheOn-Line Encyclopedia of Integer Sequences. OEIS Foundation.
  19. ^Sloane, N. J. A. (ed.)."Sequence A275613 (Restricted Perrin pseudoprimes (Grantham definition).)".TheOn-Line Encyclopedia of Integer Sequences. OEIS Foundation.
  20. ^None of the 2402549 Lucas-Selfridge pseudoprimes below 1015 listed by DanaJacobsen (2020) is also a Perrin pseudoprime.
  21. ^Adams & Shanks (1982, p. 265, 269-270)
  22. ^Adams & Shanks (1982, p. 275),Kurtz, Shanks & Williams (1986, p. 694). This was later confirmed forn < 1014 by StevenArno (1991).
  23. ^The signature does give discriminating information on the remaining two types of primes.For example, the smallest Q-type pseudoprime 50,972,694,899,204,437,633 computed by HolgerStephan (2019) is exposed by signature conditions 14a and 14c inAdams & Shanks (1982, p. 257).
  24. ^Kurtz, Shanks & Williams (1986, p. 697)
  25. ^Stephan (2019)
  26. ^Adams & Shanks (1982, p. 280-283)
  27. ^A C/C++ implementation of the extended Perrin test can be found in the final subsection of aprevious version of this article.
  28. ^Stephan (2019)

References

[edit]

External links

[edit]
Prime number classes
By formula
By integer sequence
By property
Base-dependent
Patterns
k-tuples
By size
Complex numbers
Composite numbers
Related topics
First 60 primes
Classes ofnatural numbers
Powers and related numbers
Of the forma × 2b ± 1
Other polynomial numbers
Recursively defined numbers
Possessing a specific set of other numbers
Expressible via specific sums
2-dimensional
centered
non-centered
3-dimensional
centered
non-centered
pyramidal
4-dimensional
non-centered
Combinatorial numbers
Divisor functions
Prime omega functions
Euler's totient function
Aliquot sequences
Primorial
Otherprime factor ordivisor related numbers
Numeral system-dependent numbers
Arithmetic functions
anddynamics
Digit sum
Digit product
Coding-related
Other
P-adic numbers-related
Digit-composition related
Digit-permutation related
Divisor-related
Other
Generated via asieve
Sorting related
Graphemics related
Retrieved from "https://en.wikipedia.org/w/index.php?title=Perrin_number&oldid=1274811606#Definition"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp