NAME

Math::NumSeq::Fibbinary -- without consecutive 1 bits

SYNOPSIS

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

DESCRIPTION

The fibbinary numbers 0, 1, 2, 4, 5, 8, 9, 10, etc, being integers which don't have consecutive 1 bits in binary.

These bits also represent Fibonacci numbers used to represent i in the Zeckendorf style Fibonacci base. In that system an integer i is represented as a sum of Fibonacci numbers, for example i=20 is 13+5+1, which is the sixth, fourth and first Fibonacci numbers and becomes fibbinary 101001 binary which is 41. So at i=20 in the fibbinary number is 41.

There's more than one way to represent an integer as a sum of Fibonacci numbers, the rule in the Zeckendorf system is that each number can be used only once, and no consecutive numbers can be used. With that restriction every integer is single unique sum.

FUNCTIONS

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

$seq = Math::NumSeq::All->new (key=>value,...)

Create and return a new sequence object.

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

Return the $i'th fibbinary number.

$bool = $seq->pred($value)

Return true if $value is a fibbinary number, which means that in binary it doesn't have two consecutive 1 bits..

SEE ALSO

Math::NumSeq, Math::NumSeq::Fibonacci