The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Math::NumSeq::MathImageHypotCount -- how many times as a Pythagorean hypotenuse

SYNOPSIS

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

DESCRIPTION

The counts of how many times each integer occurs as the hypotenuse of a Pythagorean triangle, being the number of ways an integer can be expressed as the sum of two squares a^2+b^2. For example at i=25 the values is 2 since 25 can be expressed two ways, 3^3+4^4 and 0^2+5^2.

Because 0^2+k^2 == k^2 is counted, the perfect squares always have a count at least 1, but it may be more.

FUNCTIONS

$seq = Math::NumSeq::MathImageHypotCount->new ()

Create and return a new sequence object.

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

Return the number of ways $i can be expressed as the sum of two squares.

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

Return true if $value occurs as a count. All counts 0 up occur so this is simply integer $value >= 0.

SEE ALSO

Math::NumSeq

HOME PAGE

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

LICENSE

Copyright 2011, 2012 Kevin Ryde

Math-Image is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.

Math-Image is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with Math-Image. If not, see <http://www.gnu.org/licenses/>.