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, ... (A001608)
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, 2016, 2019, 2020, 2021 Kevin
52 Ryde
53
54 Math-NumSeq is free software; you can redistribute it and/or modify it
55 under the terms of the GNU General Public License as published by the
56 Free Software Foundation; either version 3, or (at your option) any
57 later version.
58
59 Math-NumSeq is distributed in the hope that it will be useful, but
60 WITHOUT ANY WARRANTY; without even the implied warranty of
61 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
62 General Public License for more details.
63
64 You should have received a copy of the GNU General Public License along
65 with Math-NumSeq. If not, see <http://www.gnu.org/licenses/>.
66
67
68
69perl v5.38.0 2023-07-20 Math::NumSeq::Perrin(3)