NAME

Math::NumSeq::SqrtContfracPeriod -- period of square root continued fractions

SYNOPSIS

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

DESCRIPTION

This the period of the repeating part of the continued fraction expansion of sqrt(i).

0, 1, 2, 0, 1, 2, 4, 2, etc

For example sqrt(3) is 1 then two terms 1,2 repeating, for period 2. Perfect squares terminate at the first term of the continued fraction, with no repeating part, and the period for them is taken to be 0.

FUNCTIONS

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

$seq = Math::NumSeq::SqrtContfracPeriod->new (sqrt => $s)

Create and return a new sequence object giving the Contfrac expansion terms of sqrt($s).

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

Return the period of sqrt($i).

SEE ALSO

Math::NumSeq, Math::NumSeq::SqrtContfrac