1Math::NumSeq::DeletableUPsreirmeCso(n3t)ributed Perl DocMuamtehn:t:aNtuimoSneq::DeletablePrimes(3)
2
3
4

NAME

6       Math::NumSeq::DeletablePrimes -- primes deleting a digit repeatedly
7

SYNOPSIS

9        use Math::NumSeq::DeletablePrimes;
10        my $seq = Math::NumSeq::DeletablePrimes->new;
11        my ($i, $value) = $seq->next;
12

DESCRIPTION

14       The deletable primes, being primes which can have a digit removed to
15       give another prime which in turn is deletable.
16
17           2, 3, 5, 7, 13, 17, 23, 29, 31, 37, 43, ...
18           starting i=0
19
20       For example 367 is a deletable prime because it's possible to delete
21       the 6 giving prime 37 then from that delete the 3 giving prime 7.
22
23       There can be more than one chain of deleted digits, as for example 367
24       instead delete 3 to 67 then to 7.  Since the chain ends with single
25       digit prime 2, 3, 5 or 7, all values have at least one such digit.
26
27       Leading zeros are not allowed, so the high digit cannot be deleted if
28       it's followed by a zero.  For example 2003 is not a deletable prime.
29       Deleting the 2 to give 003 is not allowed (though it would be a prime),
30       and other deletes to 203 or 200 are not primes.
31
32   Radix
33       The optional "radix" parameter selects a base other than decimal.  In
34       binary "radix=>2" primes 2 and 3 which are 10 and 11 are reckoned as
35       endpoints, since there are no single-digit primes.
36

FUNCTIONS

38       See "FUNCTIONS" in Math::NumSeq for behaviour common to all sequence
39       classes.
40
41       "$seq = Math::NumSeq::DeletablePrimes->new ()"
42       "$seq = Math::NumSeq::DeletablePrimes->new (radix => $integer)"
43           Create and return a new sequence object.
44
45       "$bool = $seq->pred($value)"
46           Return true if $value is a deletable prime, in the selected radix.
47
48           In the current code a hard limit of 2**32 is placed on the $value
49           to be checked, in the interests of not going into a near-infinite
50           loop.
51

SEE ALSO

53       Math::NumSeq, Math::NumSeq::Primes, Math::NumSeq::SophieGermainPrimes
54
55
56
57perl v5.28.1                      2014-06-29  Math::NumSeq::DeletablePrimes(3)
Impressum