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-3 of 3 results.

A059323 Smaller term of closest safe prime pairs.

Original entry on oeis.org

11, 47, 167, 347, 467, 1307, 2027, 2447, 4127, 4787, 5087, 5387, 5927, 12527, 12647, 15287, 18947, 28307, 39107, 39827, 41507, 44687, 51827, 63587, 64007, 71987, 73847, 76367, 76907, 78467, 79967, 83207, 118787, 121547, 143687, 164987
Offset: 1

Views

Author

Labos Elemer, Jan 26 2001

Keywords

Examples

			11 and 23 are consecutive safe primes but not consecutive primes; 467 and 479 are consecutive safe primes and consecutive primes as well. Both 11 and 467 are here.
		

Crossrefs

Programs

  • Magma
    [p:p in PrimesUpTo(165000)| IsPrime(p+12) and IsPrime((p-1) div 2) and IsPrime( (p+11) div 2)]; // Marius A. Burtea, Jan 13 2020
  • Mathematica
    seqQ[n_] := And @@ PrimeQ[{n, n+12, (n-1)/2, (n+11)/2}]; Select[Range[165000], seqQ] (* Amiram Eldar, Jan 13 2020 *)

Formula

{x| both x and x+12 are safe primes}; Intersection(12+A005385, primes)

Extensions

Offset corrected by Amiram Eldar, Jan 13 2020

A059327 a(n) is smallest safe prime (A005385) such that a(n) + 12*n is the next safe prime, i.e., x = (a(n) - 1)/2 and x + 6*n are closest Sophie Germain primes.

Original entry on oeis.org

11, 23, 227, 179, 107, 1367, 263, 887, 2099, 719, 587, 8819, 3467, 1019, 10163, 27827, 1619, 7823, 27299, 2207, 44267, 3203, 7247, 5099, 11807, 45887, 18119, 15803, 79559, 13163, 40127, 42839, 20663, 79979, 17483, 53267, 47963, 33863
Offset: 1

Views

Author

Labos Elemer, Jan 26 2001

Keywords

Examples

			{11, 23, 227, 179, 107, ...} are the smallest safe primes such that {11+12, 23+24, 227+36, 179+48, 107+60, ...} = {23, 47, 263, 227, 167, ...} are their next safe primes to which the corresponding Sophie Germain primes are {11, 23, 131, 113, 83, ...} respectively.
		

Crossrefs

Programs

  • Mathematica
    safeQ[p_] := PrimeQ[(p-1)/2]; max = 38; seq = Table[0, {max}]; c=0; p1 = p2 = 11; While[c < max, p2 = NextPrime[p2]; If[safeQ[p2], d = (p2 - p1)/12; If[d <= max && seq[[d]] == 0, c++; seq[[d]] = p1]; p1 = p2]]; seq (* Amiram Eldar, Jan 13 2020 *)

Extensions

Offset corrected by Amiram Eldar, Jan 13 2020

A059322 First differences of sequence of consecutive safe primes.

Original entry on oeis.org

2, 4, 12, 24, 12, 24, 24, 60, 12, 48, 36, 84, 12, 24, 84, 12, 24, 60, 24, 132, 120, 24, 24, 96, 36, 168, 96, 24, 12, 48, 72, 48, 36, 96, 204, 84, 120, 12, 24, 36, 108, 240, 12, 120, 240, 60, 24, 60, 36, 24, 96, 48, 36, 264, 156, 156, 24, 60, 84, 60, 72, 48, 12, 120, 24
Offset: 1

Views

Author

Labos Elemer, Jan 26 2001

Keywords

Comments

Except for (5,7) and (7,11), all terms are divisible by 12, since safe primes are congruent to 5 modulo 6 except 7 and safe_prime + 6 is not a safe prime. Closest safe primes differ by 12 like (11,23) or (83207,83219).

Crossrefs

Programs

  • Mathematica
    Differences[Select[Prime[Range[500]],PrimeQ[(#-1)/2]&]]  (* Harvey P. Dale, Jan 12 2011 *)
  • PARI
    list(lim) = {my(p1 = 5); forprime(p2 = 7, lim, if(isprime((p2-1)/2), print1(p2-p1, ", "); p1 = p2));} \\ Amiram Eldar, Mar 02 2025

Formula

a(n) = A005385(n+1) - A005385(n). [corrected by Harvey P. Dale, Jan 12 2011 and Zak Seidov, Sep 19 2016]

Extensions

Offset corrected by Amiram Eldar, Mar 02 2025
Showing 1-3 of 3 results.