%I #14 Mar 17 2014 13:34:32
%S 4,6,9,15,30,105,420,2310,3465,15015,180180,765765,4084080,106696590,
%T 247342095,892371480,3011753745,9704539845,100280245065,103515091680,
%U 4412330782860,29682952539240,634473110526255,22514519501013540
%N Increasing sequence obtained by union of two sequences {b(n)} and {c(n)}, where b(n) is the smallest odd composite number m such that both m-2 and m+2 are prime and the set of distinct prime factors of m consists of the first n odd primes and c(n) is the smallest composite number m such that both m-1 and m+1 are primes and the set of the distinct prime factors of m consists of the first n primes.
%C This sequence is different from A070826 and A118750.
%e 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.
%t 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 *)
%o (UBASIC)
%o 10 'A136358, _Enoch Haga_, Jun 19 2009'
%o 11 'compute and combine input 2 or 3 separately; begin with 4 and 9
%o 20 input "prime, 2 or 3";A
%o 30 if A=2 or A=3 then B=nxtprm(A)
%o 40 print A;B;:R=A*B:print R;:stop
%o 50 if even(R)=1 then if R-1=prmdiv(R-1) and R+1=prmdiv(R+1) then print "*"
%o 60 if even(R)=0 then if R-2=prmdiv(R-2) and R+2=prmdiv(R+2) then print "+"
%o 61 print R:stop
%o 70 B=nxtprm(B):R=B*R
%o 90 print B;R:stop
%o 100 goto 50
%o - _Enoch Haga_, Jul 11 2009
%Y Cf. A136349-A136357, A070826, A118750.
%K easy,nonn
%O 1,1
%A _Enoch Haga_, Dec 25 2007
%E Edited, corrected and extended by _Farideh Firoozbakht_, Aug 13 2009
|