1Math::NumSeq::SophieGerUmsaeirnPCroinmtersi(b3u)ted PerlMaDtohc:u:mNeunmtSaetqi:o:nSophieGermainPrimes(3)
2
3
4
6 Math::NumSeq::SophieGermainPrimes -- Sophie Germain primes p and 2*p+1
7 prime
8
10 use Math::NumSeq::SophieGermainPrimes;
11 my $seq = Math::NumSeq::SophieGermainPrimes->new;
12 my ($i, $value) = $seq->next;
13
15 The primes P for which 2*P+1 is also prime,
16
17 2, 3, 5, 11, 23, 29, 41, 53, 83, 89, 113, 131, 173, 179, ...
18 starting i=1
19
21 See "FUNCTIONS" in Math::NumSeq for behaviour common to all sequence
22 classes.
23
24 "$seq = Math::NumSeq::SophieGermainPrimes->new ()"
25 Create and return a new sequence object.
26
27 "$bool = $seq->pred($value)"
28 Return true if $value is a Sophie Germain prime, meaning both
29 $value and "2*$value+1" are prime.
30
31 "$i = $seq->value_to_i_estimate($value)"
32 Return an estimate of the i corresponding to $value.
33
34 Currently this is the same as the TwinPrimes estimate. Is it a
35 conjecture by Hardy and Littlewood that the two are asymptotically
36 the same? In any case the result is roughly a factor 0.9 too small
37 for the small to medium size integers this module might calculate.
38 (See Math::NumSeq::TwinPrimes.)
39
41 Next
42 "next()" is implemented by a "Math::NumSeq::Primes" sequence filtered
43 for primes where 2P+1 is a prime too. Dana Jacobsen noticed this is
44 faster than running a second Primes iterator for primes 2P+1. This is
45 since for a prime P often 2P+1 has a small factor such as 3, 5 or 11.
46 A factor 3 occurs for any P=6k+1 since in that case 2P+1 is a multiple
47 of 3. What else can be said about the density or chance of a small
48 factor?
49
51 Math::NumSeq, Math::NumSeq::Primes, Math::NumSeq::TwinPrimes
52
54 <http://user42.tuxfamily.org/math-numseq/index.html>
55
57 Copyright 2010, 2011, 2012, 2013, 2014, 2016, 2017 Kevin Ryde
58
59 Math-NumSeq is free software; you can redistribute it and/or modify it
60 under the terms of the GNU General Public License as published by the
61 Free Software Foundation; either version 3, or (at your option) any
62 later version.
63
64 Math-NumSeq is distributed in the hope that it will be useful, but
65 WITHOUT ANY WARRANTY; without even the implied warranty of
66 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
67 General Public License for more details.
68
69 You should have received a copy of the GNU General Public License along
70 with Math-NumSeq. If not, see <http://www.gnu.org/licenses/>.
71
72
73
74perl v5.30.1 2020-01-3M0ath::NumSeq::SophieGermainPrimes(3)