Kevin Ryde > Math-NumSeq-67 > Math::NumSeq::PisanoPeriodSteps

Math-NumSeq-67.tar.gz

Dependencies

Annotate this POD

Website

# CPAN RT

 Open 0
View/Report Bugs
Module Version: 67   Source   Latest Release: Math-NumSeq-69

# NAME

Math::NumSeq::PisanoPeriodSteps -- Fibonacci frequency and Leonardo logarithm

# SYNOPSIS

``` use Math::NumSeq::PisanoPeriodSteps;
my \$seq = Math::NumSeq::PisanoPeriodSteps->new;
my (\$i, \$value) = \$seq->next;```

# DESCRIPTION

This is the number of times the `PisanoPeriod` must be applied before reaching an unchanging value.

```    0, 4, 3, 2, 3, 1, 2, 2, 1, 2, 3, 1, 3, 2, 3, 1, 2, 1, 2, ...
starting i=1```

As per Fulton and Morris

"On arithmetical functions related to the Fibonacci numbers", Acta Arithmetica, volume 16, 1969, pages 105-110. http://matwbn.icm.edu.pl/ksiazki/aa/aa16/aa1621.pdf

repeatedly applying the PisanoPeriod eventually reaches an m which is unchanging, ie. for which PisanoPeriod(m)==m. For example i=5 goes

```    PisanoPeriod(5)=20
PisanoPeriod(20)=60
PisanoPeriod(60)=60
PisanoPeriod(120)=120
so value=3 applications until to reach unchanging 120```

## Leonardo Logarithm

The unchanging period reached is always of the form

`    m = 24 * 5^(l-1)`

The "l" exponent is the Leonardo logarithm. Option `values_type => "log"` returns that as the sequence values.

```    0, 1, 1, 1, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, ...
starting i=1```

For example the i=5 above ends at m=120=24*5^1 so l-1=1 is l=2 for the sequence value.

# FUNCTIONS

See "FUNCTIONS" in Math::NumSeq for behaviour common to all sequence classes.

`\$seq = Math::NumSeq::PisanoPeriodSteps->new ()`
`\$seq = Math::NumSeq::PisanoPeriodSteps->new (values_type => \$str)`

Create and return a new sequence object.

## Random Access

`\$value = \$seq->ith(\$i)`

Return the count or logarithm of `\$i`.

http://user42.tuxfamily.org/math-numseq/index.html