NAME
App::MathImage::NumSeq::HypotCount -- how many times as a Pythagorean hypotenuse
SYNOPSIS
use App::MathImage::NumSeq::HypotCount;
my $seq = App::MathImage::NumSeq::HypotCount->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 = App::MathImage::NumSeq::HypotCount->new (key=>value,...)
-
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 occur so this is simply any non-negative$value
.
SEE ALSO
HOME PAGE
http://user42.tuxfamily.org/math-image/index.html
LICENSE
Copyright 2011 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/>.