cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-4 of 4 results.

A059455 Safe primes which are also Sophie Germain primes.

Original entry on oeis.org

5, 11, 23, 83, 179, 359, 719, 1019, 1439, 2039, 2063, 2459, 2819, 2903, 2963, 3023, 3623, 3779, 3803, 3863, 4919, 5399, 5639, 6899, 6983, 7079, 7643, 7823, 10163, 10799, 10883, 11699, 12203, 12263, 12899, 14159, 14303, 14699, 15803, 17939
Offset: 1

Views

Author

Labos Elemer, Feb 02 2001

Keywords

Comments

Primes p such that both (p-1)/2 and 2*p+1 are prime.
Except for 5, all are congruent to 11 modulo 12.
Primes "inside" Cunningham chains of first kind.
Infinite under Dickson's conjecture. - Charles R Greathouse IV, Jul 18 2012
See A162019 for the subset of a(n) that are "reproduced" by the application of the transformations (a(n)-1)/2 and 2*a(n)+1 to the set a(n). - Richard R. Forberg, Mar 05 2015

Examples

			83 is a term because it is prime and 2*83+1 = 167 and (83-1)/2 = 41 are both primes.
		

Crossrefs

Programs

  • Magma
    [p: p in PrimesUpTo(20000) |IsPrime((p-1) div 2) and IsPrime(2*p+1)]; // Vincenzo Librandi, Oct 31 2014
    
  • Mathematica
    lst={}; Do[p=Prime[n]; If[PrimeQ[(p-1)/2]&&PrimeQ[2*p+1], AppendTo[lst, p]], {n, 7!}]; lst (* Vladimir Joseph Stephan Orlovsky, Dec 02 2008 *)
    Select[Prime[Range[1000]], AllTrue[{(# - 1)/2, 2 # + 1}, PrimeQ] &] (* requires Mathematica 10+; Feras Awad, Dec 19 2018 *)
  • PARI
    forprime(p=2,1e5,if(isprime(p\2)&&isprime(2*p+1),print1(p", "))) \\ Charles R Greathouse IV, Jul 15 2011
    
  • Python
    from itertools import count, islice
    from sympy import isprime, prime
    def A059455_gen(): # generator of terms
        return filter(lambda p:isprime(p>>1) and isprime(p<<1|1),(prime(i) for i in count(1)))
    A059455_list = list(islice(A059455_gen(),10)) # Chai Wah Wu, Jul 12 2022

Formula

A156660(a(n))*A156659(a(n)) = 1; A156877 gives numbers of these numbers <= n. - Reinhard Zumkeller, Feb 18 2009

A156874 Number of Sophie Germain primes <= n.

Original entry on oeis.org

0, 1, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10
Offset: 1

Views

Author

Reinhard Zumkeller, Feb 18 2009

Keywords

Comments

a(n) = Sum_{k=1..n} A156660(k).
a(n) = A156875(2*n+1).
Hardy-Littlewood conjecture: a(n) ~ 2*C2*n/(log(n))^2, where C2=0.6601618158... is the twin prime constant (see A005597).
The truth of the above conjecture would imply that there exists an infinity of Sophie Germain primes (which is also conjectured).
a(n) ~ 2*C2*n/(log(n))^2 is also conjectured by Hardy-Littlewood for the number of twin primes <= n.

Examples

			a(120) = #{2, 3, 5, 11, 23, 29, 41, 53, 83, 89, 113} = 11.
		

Crossrefs

Cf. A005384 Sophie Germain primes p: 2p+1 is also prime.
Cf. A092816.

Programs

  • Mathematica
    Accumulate[Table[Boole[PrimeQ[n]&&PrimeQ[2n+1]],{n,1,200}]] (* Enrique Pérez Herrero, Apr 26 2012 *)
    Accumulate[Table[If[AllTrue[{n,2n+1},PrimeQ],1,0],{n,200}]]

Formula

a(10^n)= A092816(n). - Enrique Pérez Herrero, Apr 26 2012

Extensions

Edited and commented by Daniel Forgues, Jul 31 2009

A156875 Number of safe primes <= n.

Original entry on oeis.org

0, 0, 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
Offset: 1

Views

Author

Reinhard Zumkeller, Feb 18 2009

Keywords

Comments

a(n) = SUM(A156659(k): 1<=k<=n);
a(n) = A156874(floor((n-1)\2)).

Examples

			a(120) = #{5, 7, 11, 23, 47, 59, 83, 107} = 8.
		

Crossrefs

A156876 Number of primes <= n that are safe primes or Sophie Germain primes.

Original entry on oeis.org

0, 1, 2, 2, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12
Offset: 1

Views

Author

Reinhard Zumkeller, Feb 18 2009

Keywords

Examples

			a(120) = #{2,3,5,7,11,23,29,41,47,53,59,83,89,107,113} = 15.
		

Crossrefs

Programs

  • Mathematica
    Accumulate[Table[If[AllTrue[{n,2n+1},PrimeQ]||AllTrue[{n,(n-1)/2}, PrimeQ],1,0],{n,100}]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Sep 24 2019 *)
  • PARI
    a(n) = my(nb=0); forprime(p=2, n, if (isprime(2*p+1) || isprime((p-1)/2), nb++)); nb; \\ Michel Marcus, Nov 06 2022

Formula

a(n) = A156874(n)+A156875(n)-A156877(n) = A000720(n)-A156878(n).
Showing 1-4 of 4 results.