++ed by:

2 PAUSE users

Kevin Ryde


Math::NumSeq::LuckyNumbers -- sieved out multiples by the sequence itself


 use Math::NumSeq::LuckyNumbers;
 my $seq = Math::NumSeq::LuckyNumbers->new;


This is the so-called "Lucky" numbers obtained by sieving out multiples taken from the sequence itself

    starting i=1

The sieve begins with the odd numbers


Then sieve[2]=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[3]=7 means remove every seventh number, so 19 etc, to leave


Then sieve[4]=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).



$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)

So value_to_i_estimate() returns $value/log($value).


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




Copyright 2012, 2013, 2014 Kevin Ryde


