1Math::NumSeq::Perrin(3)User Contributed Perl DocumentatioMnath::NumSeq::Perrin(3)
2
3
4
6 Math::NumSeq::Perrin -- Perrin sequence
7
9 use Math::NumSeq::Perrin;
10 my $seq = Math::NumSeq::Perrin->new;
11 my ($i, $value) = $seq->next;
12
14 The Perrin sequence,
15
16 3, 0, 2, 3, 2, 5, 5, 7, 10, 12, 17, 22, 29, 39, 51, etc
17
18 which is the recurrence
19
20 P(i) = P(i-2) + P(i-3)
21
22 starting from 3,0,2. So for example 29 is 12+17.
23
24 12, 17, 22, 29
25
26 | | ^
27 | | |
28 +---+---add-+
29
31 See "FUNCTIONS" in Math::NumSeq for behaviour common to all sequence
32 classes.
33
34 "$seq = Math::NumSeq::Perrin->new (length => $integer)"
35 Create and return a new sequence object.
36
37 Random Access
38 "$value = $seq->ith($i)"
39 Return the $i'th value from the sequence.
40
41 "$i = $seq->value_to_i_estimate($value)"
42 Return an estimate of the i corresponding to $value.
43
45 Math::NumSeq, Math::NumSeq::Fibonacci
46
48 <http://user42.tuxfamily.org/math-numseq/index.html>
49
51 Copyright 2010, 2011, 2012, 2013, 2014 Kevin Ryde
52
53 Math-NumSeq is free software; you can redistribute it and/or modify it
54 under the terms of the GNU General Public License as published by the
55 Free Software Foundation; either version 3, or (at your option) any
56 later version.
57
58 Math-NumSeq is distributed in the hope that it will be useful, but
59 WITHOUT ANY WARRANTY; without even the implied warranty of
60 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
61 General Public License for more details.
62
63 You should have received a copy of the GNU General Public License along
64 with Math-NumSeq. If not, see <http://www.gnu.org/licenses/>.
65
66
67
68perl v5.28.0 2014-06-29 Math::NumSeq::Perrin(3)