OFFSET
1,1
COMMENTS
A clearer definition of the sequence: a(n) is the smallest odd composite number m such that m - 2 is prime and the set of the distinct prime factors of m equals the set of the first n odd primes. - Farideh Firoozbakht, Jun 30 2009
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..200
FORMULA
Compute N = product of the first n odd primes. If N-2 is prime, add N to the sequence. Otherwise test 3N, 5N, 7N, 9N, ... until kN - 2 is prime, subject to A006530(k) <= n+1.
EXAMPLE
The first odd prime is 3, 3*3-2 = 7 is prime so a(1) = 9.
The product of the first two odd primes is 15, and 15-2 is prime, so a(2) = 15.
MATHEMATICA
a[n_]:=(c=Product[Prime[k], {k, 2, n+1}]; For[m=1, !(!PrimeQ[c (2m-1)]&&PrimeQ[c(2m-1)-2]&&Length[FactorInteger[c(2m-1)]]==n), m++ ]; c(2m-1)); Table[a[n], {n, 20}] (* Enoch Haga, Jul 02 2009 *)
PROG
(PARI) sm(n, x)=forprime(p=2, x, n/=p^valuation(n, p)); n==1
a(n)=my(m=factorback(primes(n+1)[2..n+1]), k, p=prime(n+1)); while(!isprime(k++*m-2) && sm(k, p), ); k*m \\ Charles R Greathouse IV, Sep 14 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Enoch Haga, Dec 25 2007
EXTENSIONS
More terms, better title, and Mathematica program from Farideh Firoozbakht received Jun 30 2009. - Enoch Haga, Jul 02 2009
Further editing by Charles R Greathouse IV, Oct 05 2009
STATUS
approved