cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A131188 Indices of products of twin primes in the semiprimes.

Original entry on oeis.org

6, 13, 48, 103, 270, 508, 1001, 1413, 2724, 3052, 4859, 5668, 8029, 9062, 9608, 12558, 13828, 17319, 18823, 22781, 28077, 40162, 42359, 48113, 60703, 71793, 79161, 83792, 90129, 94954, 140436, 144445, 146452, 156704, 165199, 218110, 223095
Offset: 1

Views

Author

Zak Seidov, Sep 25 2007

Keywords

Examples

			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.
		

Crossrefs

Cf. A128301.

Programs

  • 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] 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 *)

Formula

{i: A001358(i) = A001359(k) * A006512(k), for some k > 0}. - R. J. Mathar, Oct 26 2007

Extensions

More terms from R. J. Mathar, Oct 26 2007