OFFSET
1,1
EXAMPLE
a(1)=4 is preceded by 3 and followed by 5, both primes; a(3)=9, preceded by 7 and followed by 11, both primes.
MATHEMATICA
b[n_]:=(d=Product[Prime[k], {k, n}]; For[m=1, !(!PrimeQ[d*m]&&PrimeQ[d*m-1] &&PrimeQ[d*m+1]&&Length[FactorInteger[c*m]]==n), m++ ]; d*m); c[n_]:=(d=Product [Prime[k], {k, 2, n+1}]; For[m=1, !(!PrimeQ[d*(2*m-1)]&&PrimeQ[d(2m-1)-2]&&PrimeQ [d(2m-1)+2]&&Length[FactorInteger[d(2m-1)]]==n), m++ ]; d(2m-1)); Take[Union[Table [b[k], {k, 24}], Table[c[k], {k, 24}]], 24] (* Farideh Firoozbakht, Aug 13 2009 *)
PROG
(UBASIC)
10 'A136358, Enoch Haga, Jun 19 2009'
11 'compute and combine input 2 or 3 separately; begin with 4 and 9
20 input "prime, 2 or 3"; A
30 if A=2 or A=3 then B=nxtprm(A)
40 print A; B; :R=A*B:print R; :stop
50 if even(R)=1 then if R-1=prmdiv(R-1) and R+1=prmdiv(R+1) then print "*"
60 if even(R)=0 then if R-2=prmdiv(R-2) and R+2=prmdiv(R+2) then print "+"
61 print R:stop
70 B=nxtprm(B):R=B*R
90 print B; R:stop
100 goto 50
- Enoch Haga, Jul 11 2009
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Enoch Haga, Dec 25 2007
EXTENSIONS
Edited, corrected and extended by Farideh Firoozbakht, Aug 13 2009
STATUS
approved