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

NAME

Math::NumSeq::PowerSieve -- sieved out powers

SYNOPSIS

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

DESCRIPTION

This is repeated sieving out of powers of a base integer. The default is 2

    1, 3, 5, 9, 11, 13, 17, 21, 25, 27, 29, 33, 35, 37, 43, 49, ...

The sieve starts with all integers

    1,2,3,4,5,6,7,8,9,10,11,12,13

Then sieve out all the multiple of 2 positions (which leaves the odd numbers)

    1,3,5,7,9,11,13,15,17,19,21,23,25,...

Then sieve out all the multiple of 4 positions, for example 7 at position 4 is the first removed

    1,3,5,9,11,13,17,19,21,25,...

Then multiple of 8 positions (value 19 here), then 16, 32, etc.

FUNCTIONS

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

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

Create and return a new sequence object.

SEE ALSO

Math::NumSeq, Math::NumSeq::ReRound, Math::NumSeq::ReReplace

HOME PAGE

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

LICENSE

Copyright 2012 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/>.