A059322 First differences of sequence of consecutive safe primes.
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
Keywords
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000 (terms 1..5001 from G. C. Greubel)
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
Comments