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

NAME

Math::NumSeq::TotientStepsSum -- sum of repeated totients to reach 1

SYNOPSIS

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

DESCRIPTION

The sum of the totients on repeatedly applying the totient function to reach 1. For example i=5 applying the totient function goes 5- > 4 -> 2 -> 1 so total value=5+4+2+1=12.

The default is to include the initial i value itself in the sum, with including_self => 0 it's excluded, in which case i=5 has value=4+2+1=7.

See Math::NumSeq::TotientPerfect for starting i values which have a sum equal to i itself.

FUNCTIONS

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

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

Create and return a new sequence object.

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

Return the totient steps sum running i down to 1.

SEE ALSO

Math::NumSeq, Math::NumSeq::Totient, Math::NumSeq::TotientSteps

HOME PAGE

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

LICENSE

Copyright 2011 Kevin Ryde

Math-NumSeq 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-NumSeq 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-NumSeq. If not, see <http://www.gnu.org/licenses/>.