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.

Showing 1-10 of 13 results. Next

A123375 Least k such that the difference between consecutive semiprimes A065516(k) equals n, or 0 if no such k exists.

Original entry on oeis.org

3, 1, 2, 4, 24, 6, 10, 56, 50, 78, 34, 320, 249, 186, 463, 762, 598, 1238, 422, 760, 3760, 3585, 9214, 1765, 4112, 13447, 6675, 4585, 68498, 8112, 10083, 8650, 86203, 49433, 35085, 20641, 458421, 8861, 366314, 157857, 169147, 487115, 277440, 563951, 511757, 920602, 75150
Offset: 1

Views

Author

Alexander Adamchuk, Nov 09 2006

Keywords

Comments

a(n) equals least k such that A065516(k) = n, or 0 if no such k exists. Conjecture: a(n)>0 exists for all n.

Examples

			A065516(n) begins {2, 3, 1, 4, 1, 6, 1, 3, 1, 7, 1, 1, 3, 1, 7, 3, 2, 4, 2, 1, 4, 3, 4, 5, ...}.
Thus a(1) = 3, a(2) = 1, a(3) = 2, a(4) = 4, a(5) = 24.
		

Crossrefs

Cf. A001358 (semiprimes), A065516 (differences between semiprimes), A131109.

Programs

  • Maple
    nextSprime := proc(n) local res ; res := n+1 ; while numtheory[bigomega](res) <> 2 do res := res+1 ; od ; RETURN(res) ; end ; nmax := 500 ; kmax := 500000 ; a := array(1..nmax) ; for i from 1 to nmax do a[i] := 0 ; od : sp1 := 4 : sp2 := nextSprime(sp1) : n := sp2-sp1 : a[n] := 1 : for k from 2 to kmax do sp1 := sp2 ; sp2 := nextSprime(sp1) ; n := sp2-sp1 ; if a[n] = 0 then a[n] := k ; fi ; od : for i from 1 to nmax do if a[i] = 0 then break ; else printf("%d,",a[i]) ; fi ; od : # R. J. Mathar, Jan 13 2007
  • Mathematica
    Table[k=6;While[FreeQ[b=Differences[Select[Range@k++,PrimeOmega[#]==2&]],n]];
    Length@b,{n,11}] (* Giorgos Kalogeropoulos, Apr 02 2021 *)

Extensions

Corrected and extended by R. J. Mathar, Jan 13 2007
More terms from David A. Corneth, Apr 02 2021

A215231 Increasing gaps between semiprimes.

Original entry on oeis.org

2, 3, 4, 6, 7, 11, 14, 19, 20, 24, 25, 28, 30, 32, 38, 47, 54, 55, 70, 74, 76, 82, 85, 87, 88, 95, 98, 107, 110, 112, 120, 123, 126, 146, 163, 166, 171, 174
Offset: 1

Views

Author

T. D. Noe, Aug 07 2012

Keywords

Comments

See A215232 and A217851 for the semiprimes that begin and end the gaps.
Records in A065516. - R. J. Mathar, Aug 09 2012
How long can these gaps be? In the Cramér model, with x = A215232(n), they are of length log(x)^2/log(log(x))(1 + o(1)) with probability 1. - Charles R Greathouse IV, Sep 07 2012
a(n) = A065516(A085809(n)). - Reinhard Zumkeller, Mar 23 2014

Examples

			4 is here because the difference between 10 and 14 is 4, and there is no smaller semiprimes with this property.
		

Crossrefs

Cf. A001358 (semiprimes), A131109, A215232, A217851.
Cf. A005250 (increasing gaps between primes).
Cf. A239673 (increasing gaps between sphenic numbers).

Programs

  • Haskell
    a215231 n = a215231_list !! (n-1)
    (a215231_list, a085809_list) = unzip $ (2, 1) : f 1 2 a065516_list where
       f i v (q:qs) | q > v = (q, i) : f (i + 1) q qs
                    | otherwise = f (i + 1) v qs
    -- Reinhard Zumkeller, Mar 23 2014
  • Mathematica
    SemiPrimeQ[n_Integer] := If[Abs[n] < 2, False, (2 == Plus @@ Transpose[FactorInteger[Abs[n]]][[2]])]; nextSemiprime[n_] := Module[{m = n + 1}, While[! SemiPrimeQ[m], m++]; m]; t = {{0, 0}}; s1 = nextSemiprime[1]; While[s1 < 10^7, s2 = nextSemiprime[s1]; d = s2 - s1; If[d > t[[-1, 1]], AppendTo[t, {d, s1}]; Print[{d, s1}]]; s1 = s2]; t = Rest[t]; Transpose[t][[1]]

Extensions

a(27)-a(31) from Donovan Johnson, Aug 07 2012
a(32)-a(38) from Donovan Johnson, Sep 20 2012

A264044 Numbers n such that n and n+4 are consecutive semiprimes.

Original entry on oeis.org

10, 51, 58, 65, 87, 111, 129, 209, 249, 274, 291, 305, 335, 377, 382, 403, 407, 447, 454, 485, 489, 493, 497, 529, 538, 629, 681, 699, 713, 749, 767, 781, 785, 803, 831, 889, 901, 917, 939, 951, 961, 985, 989, 1007, 1037, 1073, 1115, 1191, 1207
Offset: 1

Views

Author

Zak Seidov, Nov 02 2015

Keywords

Comments

Note that a(1)=10=A131109(k=4).
Subsequence of A175648: a(1)=10=A175648(2), a(2)=51=A175648(7), a(3)=58=A175648(8), etc. - Zak Seidov, Dec 20 2017

Examples

			10=A001358(4) and 14=A001358(5).
		

Crossrefs

Programs

  • Maple
    B:= select(numtheory:-bigomega=2, [$1..2000]):
    B[select(t ->B[t+1]-B[t]=4, [$1..nops(B)-1])]; # Robert Israel, Dec 21 2017
  • Mathematica
    Select[Partition[Select[Range[1250], PrimeOmega@ # == 2 &], 2, 1], Differences@ # == {4} &][[All, 1]] (* Michael De Vlieger, Dec 20 2017 *)
    SequencePosition[Table[If[PrimeOmega[n]==2,1,0],{n,1300}],{1,0,0,0,1}][[All,1]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Sep 19 2020 *)
  • PARI
    is(n)=bigomega(n)==2 && bigomega(n+4)==2 && bigomega(n+1)!=2 && bigomega(n+2)!=2 && bigomega(n+3)!=2 \\ Charles R Greathouse IV, Nov 02 2015

A215232 Least semiprime m such that the next semiprime is m + A215231(n).

Original entry on oeis.org

4, 6, 10, 15, 26, 95, 597, 1418, 2681, 6559, 16053, 17965, 32777, 35103, 35981, 340894, 1069541, 1589662, 3586843, 5835191, 139139887, 251306317, 285074689, 327023206, 751411951, 981270902, 2655397631, 5238280946, 6498130361, 8512915573, 16328958619
Offset: 1

Views

Author

T. D. Noe, Aug 07 2012

Keywords

Comments

The semiprime m + A215231(n) is in A217851.
Matomäki & Teräväinen prove that there is almost always (in the sense of natural density) a semiprime in (x, x + log(x)^2.1]. Under RH the exponent can be chosen as 2 + e for any e > 0. - Charles R Greathouse IV, Oct 03 2022

Crossrefs

Cf. A001358 (semiprimes), A131109, A215231, A217851.
Cf. A002386 (increasing gaps between primes).

Programs

  • Mathematica
    SemiPrimeQ[n_Integer] := If[Abs[n] < 2, False, (2 == Plus @@ Transpose[FactorInteger[Abs[n]]][[2]])]; nextSemiprime[n_] := Module[{m = n + 1}, While[! SemiPrimeQ[m], m++]; m]; t = {{0, 0}}; s1 = nextSemiprime[1]; While[s1 < 10^7, s2 = nextSemiprime[s1]; d = s2 - s1; If[d > t[[-1, 1]], AppendTo[t, {d, s1}]; Print[{d, s1}]]; s1 = s2]; t = Rest[t]; Transpose[t][[2]]
  • PARI
    r=0;s=2;for(n=3,1e7,if(bigomega(n)==2,if(n-s>r,r=n-s;print1(s", "));s=n)) \\ Charles R Greathouse IV, Sep 07 2012

Extensions

a(27)-a(31) from Donovan Johnson, Aug 07 2012

A217851 Least semiprime m such that the previous semiprime is m - A215231(n).

Original entry on oeis.org

6, 9, 14, 21, 33, 106, 611, 1437, 2701, 6583, 16078, 17993, 32807, 35135, 36019, 340941, 1069595, 1589717, 3586913, 5835265, 139139963, 251306399, 285074774, 327023293, 751412039, 981270997, 2655397729, 5238281053, 6498130471, 8512915685, 16328958739
Offset: 1

Views

Author

T. D. Noe, Nov 07 2012

Keywords

Comments

These are the semiprimes that are the upper end of the gaps of length A215231. The lower end semiprimes are given in A215232.

Crossrefs

Cf. A001358 (semiprimes), A131109, A215231, A215232.

A264045 Numbers n such that n and n+5 are consecutive semiprimes.

Original entry on oeis.org

69, 77, 106, 161, 178, 221, 254, 309, 314, 329, 341, 386, 398, 417, 422, 473, 554, 662, 674, 689, 758, 794, 934, 974, 998, 1094, 1121, 1149, 1169, 1214, 1294, 1502, 1517, 1522, 1541, 1569, 1673
Offset: 1

Views

Author

Zak Seidov, Nov 02 2015

Keywords

Comments

Note that a(1)=69=A131109(k=5).

Examples

			a(1)=69=A001358(24) and a(1)+k=74=A001358(25).
		

Crossrefs

Programs

  • Mathematica
    Flatten[Position[Partition[Table[If[PrimeOmega[n]==2,1,0],{n,2000}],6,1], ?(#=={1,0,0,0,0,1}&)]] (* _Harvey P. Dale, Dec 16 2015 *)
  • PARI
    is(n)=if(n%4==1, isprime((n+5)/2) && bigomega(n)==2, n%4==2 && isprime(n/2) && bigomega(n+5)==2) && bigomega(n+1)!=2 && bigomega(n+2)!=2 && bigomega(n+3)!=2 && bigomega(n+4)!=2 \\ Charles R Greathouse IV, Nov 02 2015

Formula

a(n) >> n log n. - Charles R Greathouse IV, Nov 02 2015

A264046 Numbers k such that k and k+6 are consecutive semiprimes.

Original entry on oeis.org

15, 123, 365, 371, 505, 545, 573, 591, 649, 707, 807, 843, 943, 1067, 1159, 1247, 1357, 1405, 1529, 1555, 1633, 1739, 1745, 1829, 1843, 1897, 1909, 1985, 2149, 2159, 2209, 2285, 2329, 2353, 2363, 2407, 2413, 2463, 2501, 2643, 2773, 2779
Offset: 1

Views

Author

Zak Seidov, Nov 02 2015

Keywords

Comments

Note that a(1) = 15 = A131109(k=6).

Examples

			15 = A001358(6) and 21 = A001358(7).
		

Crossrefs

Programs

  • Mathematica
    Select[Partition[Select[Range[3000],PrimeOmega[#]==2&],2,1],#[[2]]-#[[1]]==6&][[;;,1]] (* Harvey P. Dale, Dec 24 2023 *)
  • PARI
    is(n)=if(bigomega(n)!=2 || bigomega(n+6)!=2, return(0)); for(i=1,5,if(bigomega(n+i)==2, return(0))); 1 \\ Charles R Greathouse IV, Nov 02 2015

A278351 Least number that is the start of a prime-semiprime gap of size n.

Original entry on oeis.org

2, 7, 26, 97, 341, 241, 6091, 3173, 2869, 2521, 16022, 26603, 114358, 41779, 74491, 39343, 463161, 104659, 248407, 517421, 923722, 506509, 1930823, 584213, 2560177, 4036967, 4570411, 4552363, 7879253, 4417813, 27841051, 5167587, 13683034, 9725107, 47735342, 25045771, 63305661
Offset: 1

Views

Author

Keywords

Comments

A prime-semiprime gap of n is defined as the difference between p & q, p being either a prime, A000040, or a semiprime, A001358, and q being the next greater prime or semiprime, see examples.
The corresponding numbers at the end of the prime-semiprime gaps, i.e., a(n)+n, are in A278404.
In the first 52 terms, 19 are primes and the remaining 33 are semiprime. Of the end-of-gap terms a(n)+n, 20 are primes and 32 are not. There are only 6 pairs of p and q that are both primes, and 19 pairs that are both semiprime.

Examples

			a(1) = 2 since there is a gap of 1 between 2 and 3, both of which are primes.
a(2) = 7 since there is a gap of 2 between 7 and 9, the first is a prime and the second is a semiprime.
a(3) = 26 since there is a gap of 3 between 26, a semiprime, and 29, a prime.
a(6) = 241 because the first prime-semiprime gap of size 6 is between 241 and 247.
		

Crossrefs

Programs

  • Mathematica
    nxtp[n_] := Block[{m = n + 1}, While[ PrimeOmega[m] > 2, m++]; m]; gp[_] = 0; p = 2; While[p < 1000000000, q = nxtp[p]; If[ gp[q - p] == 0, gp[q -p] = p; Print[{q -p, p}]]; p = q]; Array[gp, 40]
  • Perl
    use ntheory ":all";
    my($final,$p,$nextn,@gp) = (40,2,1);  # first 40 values in order
    forfactored {
      if (scalar(@) <= 2) { my $q = $;
        if (!defined $gp[$q-$p]) {
          $gp[$q-$p] = $p;
          while ($nextn <= $final && defined $gp[$nextn]) {
            print "$nextn $gp[$nextn]\n";
            $nextn++;
          }
          lastfor if $nextn > $final;
        }
        $p = $q;
      }
    } 3,10**14; # Dana Jacobsen, Sep 10 2018

A282407 Semiprimes p such that next semiprime after p is p + 40.

Original entry on oeis.org

741841, 1633213, 1889467, 1946677, 2210557, 2440203, 2655427, 2660857, 2729091, 2749273, 2774911, 3077323, 3724909, 3977473, 4021507, 4030891, 4323301, 4372337, 4408581, 4421713, 4608574, 4640419, 4836223, 5640861, 5691531, 6148599, 6166101, 6429853, 6786523
Offset: 1

Views

Author

Zak Seidov, Feb 14 2017

Keywords

Comments

Note that a(1) = 741841 = A131109(40).
Smallest difference between two consecutive terms occurs first at a(22060) = 1141901643 because a(22061) = 1141901683 = 1141901643 + 40.

Crossrefs

Programs

  • PARI
    is(p) = if(bigomega(p)==2 && bigomega(p+40)==2, for(i=p+1, p+39, if(bigomega(i)==2, return(0))); 1); \\ Jinyuan Wang, May 23 2021

A282424 Semiprimes p such that next semiprime after p is p + 50.

Original entry on oeis.org

1226777, 4732631, 5093729, 9210671, 12515461, 12917989, 16121409, 16183253, 16698881, 17263069, 19418903, 23003807, 24534161, 26519563, 26726659, 27625067, 29605299, 29772471, 32655031, 34027277, 34366179, 35340719, 37570683, 38117319, 38687461, 39038399, 39479381
Offset: 1

Views

Author

Zak Seidov, Feb 14 2017

Keywords

Comments

All terms are odd because even semiprime 2*p plus 50 = 2*(p+25) is multiple of 4 and not semiprime.
Note that a(1) = 1226777 = A131109(50).
Smallest possible difference is 50 but among first 10000 terms
the least difference 100 is between a(325) = 228601303 and a(326) = 228601403.

Crossrefs

Programs

  • PARI
    lista(nn) = my(r); for(k=1, nn, if(bigomega(k)==2, if(k-r==50, print1(r, ", ")); r=k)); \\ Jinyuan Wang, May 23 2021
Showing 1-10 of 13 results. Next