1Math::NumSeq::BaumSweetU(s3e)r Contributed Perl DocumentaMtaitohn::NumSeq::BaumSweet(3)
2
3
4
6 Math::NumSeq::BaumSweet -- Baum-Sweet sequence
7
9 use Math::NumSeq::BaumSweet;
10 my $seq = Math::NumSeq::BaumSweet->new;
11 my ($i, $value) = $seq->next;
12
14 The Baum-Sweet sequence
15
16 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, ...
17 starting i=0
18
19 where each value is 1 if the index i written in binary contains no odd-
20 length run of 0-bits, or 0 if it does.
21
22 Leonard E. Baum and Melvin M. Sweet, "Continued Fractions of
23 Algebraic Power Series in Characteristic 2", Annals of Mathematics,
24 volume 103, number 3, May 1976, pages 593-610.
25 "/www.jstor.org/stable/1970953" in href="http:
26
27 This sequence is the coefficients of a Laurent series which is the
28 unique solution to
29
30 f(x)^3 + (1/x)*f(x) + 1 = 0
31
32 and which they note has the bitwise interpretation above. Their
33 interest was in certain continued fractions forms for the series.
34
36 See "FUNCTIONS" in Math::NumSeq for behaviour common to all sequence
37 classes.
38
39 "$seq = Math::NumSeq::BaumSweet->new ()"
40 Create and return a new sequence object.
41
42 Random Access
43 "$value = $seq->ith($i)"
44 Return the $i'th BaumSweet number, ie. 1 or 0 according to whether
45 $i is without or with an odd-length run of 0-bits.
46
47 "$bool = $seq->pred($value)"
48 Return true if $value occurs in the sequence, which simply means 0
49 or 1.
50
52 Math::NumSeq, Math::NumSeq::GolayRudinShapiro, Math::NumSeq::Fibbinary
53
55 <http://user42.tuxfamily.org/math-numseq/index.html>
56
58 Copyright 2011, 2012, 2013, 2014, 2016, 2017, 2019, 2020 Kevin Ryde
59
60 Math-NumSeq is free software; you can redistribute it and/or modify it
61 under the terms of the GNU General Public License as published by the
62 Free Software Foundation; either version 3, or (at your option) any
63 later version.
64
65 Math-NumSeq is distributed in the hope that it will be useful, but
66 WITHOUT ANY WARRANTY; without even the implied warranty of
67 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
68 General Public License for more details.
69
70 You should have received a copy of the GNU General Public License along
71 with Math-NumSeq. If not, see <http://www.gnu.org/licenses/>.
72
73
74
75perl v5.38.0 2023-07-20 Math::NumSeq::BaumSweet(3)