OFFSET
1,1
COMMENTS
There are only 2 primes such that both p-1 and p+1 have at most 2 prime factors - 3 and 5. Proof: If p > 5 then whichever of p-1 and p+1 is divisible by 4 has at least 3 prime factors.
Primes which are not the sum of two consecutive composite numbers. - Juri-Stepan Gerasimov, Nov 15 2009
MATHEMATICA
Select[Prime[Range[500]], MemberQ[PrimeOmega[{#-1, #+1}], 2]&] (* Harvey P. Dale, Sep 04 2011 *)
PROG
(PARI) s(n) = {sr=0; ct=0; forprime(x=2, n, if(bigomega(x-1) < 3 || bigomega(x+1) < 3, print1(x" "); sr+=1.0/x; ct+=1; ); ); print(); print(ct" "sr); } \\ Lists primes p<=n such that p+-1 has at most 2 prime factors.
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Cino Hilliard, Dec 27 2002
STATUS
approved