OFFSET
1,1
LINKS
Zak Seidov, Table of n, a(n) for n = 1..300
FORMULA
EXAMPLE
Ignoring (2, 3), the first twin prime pair is (3, 5). We have 3 * 5 = 15, which is the sixth semiprime (the previous five semiprimes being 4, 6, 9, 10, 14). Hence 6 is the first term of this sequence.
The second twin prime pair is (5, 7). Then 5 * 7 = 35, which is the thirteenth semiprime (following 21, 22, 25, 26, 33, 34). Hence 13 is the second term of this sequence.
MAPLE
N:= 10^7: # to use semiprimes <= N
P:= select(isprime, [2, seq(i, i=3..N/2, 2)]):
count:= 0:
for i from 1 to numtheory:-pi(floor(sqrt(N))) do
for j from i to nops(P) while P[i]*P[j] <= N do
count:= count+1;
S[count]:= [P[i]*P[j], evalb(P[j]-P[i]=2)]
od od:
S:= sort(convert(S, list), (a, b) -> a[1]<b[1]):
select(t -> S[t][2], [$1..nops(S)]); # Robert Israel, Dec 30 2015
MATHEMATICA
s = Select[Range[10^6], PrimeOmega@ # == 2 &]; Map[Position[s, #] &, # (# + 2) &@ Select[Prime@ Range@ 160, NextPrime@ # - # == 2 &]] // Flatten (* Michael De Vlieger, Dec 31 2015 *)
Module[{upto=2*10^6, sp, tp}, sp=Select[Range[upto], PrimeOmega[#]==2&]; tp= Times@@@Select[Partition[Prime[Range[upto/2]], 2, 1], #[[2]]-#[[1]] == 2&]; Table[Position[sp, n], {n, tp}]]//Flatten (* Harvey P. Dale, Nov 03 2016 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Zak Seidov, Sep 25 2007
EXTENSIONS
More terms from R. J. Mathar, Oct 26 2007
STATUS
approved