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-5 of 5 results.

A241539 Smallest k>=1 such that the n-th semiprime + or - k are both primes, or a(n)=0 if there is no such k.

Original entry on oeis.org

1, 1, 2, 3, 3, 2, 2, 9, 6, 3, 4, 3, 6, 9, 2, 15, 12, 8, 12, 4, 15, 9, 6, 2, 15, 6, 15, 12, 3, 14, 12, 4, 15, 6, 3, 2, 12, 9, 12, 18, 9, 14, 2, 6, 3, 10, 15, 6, 6, 33, 18, 9, 8, 12, 15, 12, 4, 15, 10, 6, 6, 3, 10, 9, 24, 6, 27, 18, 14, 15, 18, 6, 21, 8, 30, 3
Offset: 1

Views

Author

Vladimir Shevelev, Apr 25 2014

Keywords

Comments

If the sequence has no zeros at least for sufficiently large n, then one can believe that, for a pair of sufficiently large semiprimes of the same parity {r,s}, there is a number k=k(r,s) such that either {r-k, s+k} or {r+k, s-k} is a pair of primes. Then, if a representation 2*n = r+s with, say, min{r,s} > log(n) is considered, then, at least for sufficiently large n, it is reduced to the Goldbach representation 2*n = p+q with primes p,q. It is natural to think that a Goldbach-like conjecture that at least every sufficiently large even number is a sum of two semiprimes could be proved more easily than the classic Goldbach conjecture (cf. Chen's theorem).

Crossrefs

Programs

  • Mathematica
    sk[s_]:=Module[{k=1},While[!PrimeQ[s+k]||!PrimeQ[s-k],k++];k]; sk/@Select[Range[300],PrimeOmega[#]==2&] (* Harvey P. Dale, Jun 07 2025 *)
  • PARI
    list(lim) = my(v=List(), t); forprime(p=2, sqrt(lim), t=p; forprime(q=p, lim\t, listput(v, t*q))); vecsort(Vec(v)) \\ From A001358
    sp = list(1000); vector(#sp, n, k=1; while(!isprime(sp[n]+k) || !isprime(sp[n]-k), k++); k) \\ Colin Barker, May 31 2014

Extensions

More terms from Peter J. C. Moses, Apr 28 2014

A241536 Smallest k>=1 such that prime(n)+k and prime(n)-k are both semiprimes, or a(n)=0 if there is no such k.

Original entry on oeis.org

0, 0, 1, 3, 0, 9, 8, 15, 2, 4, 27, 2, 8, 8, 8, 2, 10, 4, 2, 6, 4, 14, 28, 2, 32, 10, 8, 12, 14, 2, 6, 2, 4, 6, 6, 8, 2, 20, 34, 4, 24, 4, 14, 8, 12, 14, 2, 14, 8, 8, 14, 20, 6, 2, 8, 4, 20, 18, 10, 14, 16, 2, 2, 8, 8, 12, 4, 2, 8, 22, 12, 18, 26, 8, 2, 12, 18
Offset: 1

Views

Author

Vladimir Shevelev, Apr 25 2014

Keywords

Comments

If a(n)=2, then prime(n)+2 and prime(n)-2 are both semiprimes; that is, prime(n) belongs to A063643. - Michel Marcus, Mar 26 2015

Crossrefs

Programs

  • Mathematica
    sks[n_]:=Module[{k=1,p=Prime[n]},While[PrimeOmega[p+k]!=2||PrimeOmega[p-k]!=2||p-k<4,If[p-k<3,Break[]];k++];If[p-k<4,0,k]]; Array[sks,80] (* Harvey P. Dale, Dec 09 2016 *)
  • PARI
    a(n) = {p = prime(n); for (k=1, p-1, if ((bigomega(p-k)==2) && (bigomega(p+k) == 2), return (k));); return (0);} \\ Michel Marcus, Apr 25 2014

Extensions

More terms from Michel Marcus, Apr 25 2014
Name edited by Michel Marcus, Mar 26 2015

A253138 Number of ways to represent the n-th prime as the arithmetic mean of two semiprimes.

Original entry on oeis.org

0, 0, 1, 1, 0, 1, 1, 1, 1, 2, 1, 3, 2, 4, 3, 4, 3, 3, 5, 7, 6, 5, 5, 8, 8, 7, 9, 7, 10, 10, 12, 11, 15, 12, 14, 14, 13, 11, 13, 15, 15, 14, 15, 20, 14, 15, 19, 20, 16, 17, 17, 17, 21, 24, 23, 24, 28, 23, 25, 24, 27, 25, 32, 29, 25, 21, 26, 31, 31, 29, 36, 32
Offset: 1

Views

Author

Michel Lagneau, Mar 23 2015

Keywords

Comments

Conjecture: a(n)>0 for n>5.
Note that a(n) = A241535(n) = A241536(n) = 0 for n=1,2 and 5. - Michel Marcus, Mar 26 2015
Among the a(n) decompositions of prime(n) into two semiprimes (prime(n)+ k)/2 and (prime(n)-k)/2, there is one where k is minimum with k = A241536(n) and there is one where k is maximum with k = prime(n) - A241535(n).

Examples

			a(12)=3 as prime(12) = 37 = (9+65)/2 = (25+49)/2 =(35+39)/2 where 9, 25, 35, 39, 49 and 65 are semiprime.
		

Crossrefs

Programs

  • Haskell
    a253138 n = sum $ map a064911 $
       takeWhile (> 0) $ map (2 * p -) $ dropWhile (< p) a001358_list
       where p = a000040 n
    -- Reinhard Zumkeller, Mar 27 2015
  • Maple
    with(numtheory):for n from 1 to 100 do:c:=0:p:=ithprime(n):for m from 1 to p-1 do:p1:=p-m:p2:=p+m:if bigomega(p1)=2 and bigomega(p2)=2 then c:=c+1:else fi:od:printf(`%d, `,c):od:
  • Mathematica
    Reap[For[n=1, n <= 100, n++, c=0; p = Prime[n]; For[m=1, m <= p-1, m++, p1 = p-m; p2 = p+m; If[PrimeOmega[p1] == 2 && PrimeOmega[p2] == 2 , c = c+1]]; Print[c]; Sow[c]]][[2, 1]] (* Jean-François Alcover, Mar 23 2015, translated from Maple *)

A241656 Smallest semiprime, sp, such that 2n - sp is a semiprime, or a(n)=0 if there is no such sp.

Original entry on oeis.org

0, 0, 0, 4, 4, 6, 4, 6, 4, 6, 0, 9, 4, 6, 4, 6, 9, 10, 4, 6, 4, 6, 21, 9, 4, 6, 15, 10, 9, 9, 4, 6, 4, 6, 15, 10, 9, 14, 4, 6, 25, 10, 4, 6, 4, 6, 9, 9, 4, 6, 9, 9, 15, 14, 4, 6, 21, 10, 25, 9, 4, 6, 4, 6, 9, 9, 15, 14, 4, 6, 9, 10, 4, 6, 4, 6, 9, 10, 15, 14, 4, 6, 21, 9, 4, 6, 15, 10, 9, 14
Offset: 1

Views

Author

Keywords

Comments

Conjecture: every even number greater than 22 is a sum of two semiprimes. Only 2, 4, 6 & 22 cannot be so represented.
If n is prime, then a(n) must be either 4 or an odd semiprime. See A241535.
First occurrence of the k-th semiprime (A001358): 4, 6, 12, 18, 38, 27, 23, 124, 41, 326, 127, 1344, 147, 1278, 189, 3294, 757, 317, 1362, 1775, 3300, 2504, 2025, 7394, 84848, 13899, 56584, 11347, 156396, 7667, 7905, 15447, 404898, 20937, ..., .

Examples

			a(12) = 9 because 2*12 = 24 = 9 + 15, two semiprimes.
		

Crossrefs

Programs

  • Mathematica
    NextSemiPrime[n_, k_: 1] := Block[{c = 0, sgn = Sign[k]}, sp = n + sgn; While[c < Abs[k], While[ PrimeOmega[sp] != 2, If[ sgn < 0, sp--, sp++]]; If[ sgn < 0, sp--, sp++]; c++]; sp + If[sgn < 0, 1, -1]]; f[n_] := Block[{en = 2 n, sp = 4}, While[ PrimeOmega[en - sp] != 2, sp = NextSemiPrime[sp]]; If[en > sp, sp, 0]]; Array[ f, 90]

A241658 Smallest semiprime, sp, such that n - sp is a semiprime, or a(n)=0 if there is no such sp.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 4, 0, 4, 0, 6, 4, 4, 6, 6, 0, 4, 4, 6, 6, 0, 9, 9, 4, 4, 6, 6, 4, 4, 6, 6, 0, 9, 9, 10, 4, 4, 4, 6, 6, 4, 4, 6, 6, 21, 9, 9, 10, 4, 25, 6, 4, 15, 4, 10, 6, 9, 4, 9, 4, 4, 6, 6, 10, 4, 9, 6, 4, 15, 6, 10, 4, 9, 6, 14, 15, 4, 10, 6, 4, 25, 6, 10, 34, 4, 10, 6, 4, 4
Offset: 1

Views

Author

Keywords

Comments

Conjecture: every number greater than 33 is a sum of two semiprimes. Only 1, 2, 3, 4, 5, 6, 7, 9, 11, 17, 22 & 33 cannot be so represented.
If n is prime, then a(2n) must be either 4 or an odd semiprime. See A241535.
First occurrence of the k-th semiprime (A001358): 8, 12, 23, 36, 76, 54, 46, 113, 51, 185, 254, 85, 294, 1881, 378, 1035, 1514, 634, 1509, 3550, 1621, 2713, 4050, 14788, 1485, 26839, 1497, 22694, 11965, 15334, 15810, 30894, 2721, 16849, ..., .

Examples

			a(23) = 9 because 23 = 9 + 14, two semiprimes.
		

Crossrefs

Programs

  • Mathematica
    NextSemiPrime[n_, k_: 1] := Block[{c = 0, sgn = Sign[k]}, sp = n + sgn; While[c < Abs[k], While[ PrimeOmega[sp] != 2, If[ sgn < 0, sp--, sp++]]; If[ sgn < 0, sp--, sp++]; c++]; sp + If[sgn < 0, 1, -1]]; f[n_] := Block[{sp = 4}, While[ PrimeOmega[n - sp] != 2, sp = NextSemiPrime[sp]]; If[n > sp, sp, 0]]; Array[ f, 90]
  • PARI
    a(n) = {for (k=4, n-4, if ((bigomega(k) ==2) && (bigomega(n-k) == 2), return (k));); return (0);} \\ Michel Marcus, Jun 12 2014
Showing 1-5 of 5 results.