Math::NumSeq::LuckyNumbers -- sieved out multiples by the sequence itself
use Math::NumSeq::LuckyNumbers; my $seq = Math::NumSeq::LuckyNumbers->new; my ($i, $value) = $seq->next;
This is the so-called "Lucky" numbers obtained by sieving out multiples taken from the sequence itself
starting i=1 1, 3, 7, 9, 13, 15, 21, 25, 31, 33, 37, 43, 49, 51, 63, 67, ...
The sieve begins with the odd numbers
Then sieve=3 from the sequence means remove every third number, counting from the start, so remove 5,11,17, etc to leave
Then the next value sieve=7 means remove every seventh number, so 19 etc, to leave
Then sieve=9 means remove every ninth from what remains, and so on. In each case the removals count from the start of the values which remain at that stage.
It can be shown the values grow at roughly the same rate as the primes, i =~ value/log(value).
See "FUNCTIONS" in Math::NumSeq for behaviour common to all sequence classes.
$seq = Math::NumSeq::LuckyNumbers->new ()
Create and return a new sequence object.
$i = $seq->value_to_i_estimate($value)
Return an estimate of the i corresponding to
$value. It can be shown that values grow roughly at the same rate as the primes,
i ~= value/log(value)
Copyright 2012, 2013, 2014, 2016, 2019 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/>.