OFFSET
1,1
COMMENTS
Up to 83, this is the sequence of prime numbers A000040. 89 is not in the sequence because both 89-1 = 88 = 2*2*2*11 and 89+1 = 90 = 2*3*3*5 have 4 prime factors.
LINKS
Daniel Starodubtsev, Table of n, a(n) for n = 1..10000
EXAMPLE
97 is in the sequence because 97+1 = 98 = 2*7*7 has 3 prime factors.
MATHEMATICA
Select[Prime /@ Range[70], PrimeOmega[# - 1] <= 3 || PrimeOmega[# + 1] <= 3 & ] (* Jean-François Alcover, Jul 02 2013 *)
PROG
(PARI) s(n) = {sr=0; ct=0; forprime(x=2, n, if(bigomega(x-1) < 4 || bigomega(x+1) < 4, print1(x, ", "); sr+=1.0/x; ct+=1; ); ); print(); print(ct" "sr); } \\ Lists primes p<=n such that either p-1 or p+1 has at most 3 prime factors.
(Magma) bg:=func<n|&+[p[2]: p in Factorization(n)]>; [2] cat [p: p in PrimesInInterval(3, 340)| bg(p-1) le 3 or bg(p+1) le 3]; // Marius A. Burtea, Jan 16 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
Cino Hilliard, Dec 27 2002
STATUS
approved