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

A023036 Smallest positive even integer that is an unordered sum of two primes in exactly n ways.

Original entry on oeis.org

2, 4, 10, 22, 34, 48, 60, 78, 84, 90, 114, 144, 120, 168, 180, 234, 246, 288, 240, 210, 324, 300, 360, 474, 330, 528, 576, 390, 462, 480, 420, 570, 510, 672, 792, 756, 876, 714, 798, 690, 1038, 630, 1008, 930, 780, 960, 870, 924, 900, 1134, 1434, 840, 990, 1302, 1080
Offset: 0

Views

Author

David W. Wilson, Jun 14 1998

Keywords

Comments

Except for first two terms, same as A001172.
The first occurrence of k in A045917.
The graph looks like a comet. - Daniel Forgues, Jun 12 2014

Examples

			a(3) = 22 as 22 = (19+3) = (17+5) = (11+11). There are exactly 3 ways 22 can be expressed as the sum of two primes and no even number less than 22 can be so expressed.
From _Daniel Forgues_, Jun 13 2014: (Start)
Terms for n = 1..6 and corresponding sums:
  a(1) =  4 =  2 + 2;
  a(2) = 10 =  7 + 3 =  5 +  5;
  a(3) = 22 = 19 + 3 = 17 +  5 = 11 + 11;
  a(4) = 34 = 31 + 3 = 29 +  5 = 23 + 11 = 17 + 17;
  a(5) = 48 = 43 + 5 = 41 +  7 = 37 + 11 = 31 + 17 = 29 + 19;
  a(6) = 60 = 53 + 7 = 47 + 13 = 43 + 17 = 41 + 19 = 37 + 23 = 31 + 29.
(End)
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Length@ Select[2n - Prime@ Range@ PrimePi@ n, PrimeQ]; nn = 100; t = Table[0, {nn}]; k = 1; cnt = 0; While[cnt < nn, a = f@k; If[a <= nn && t[[a]] == 0, t[[a]] = 2 k; cnt++]; k++]; t (* Robert G. Wilson v, Mar 15 2011 *)

A258713 A001172(n)/2: Least k such that 2k is a sum of two odd primes in exactly n ways.

Original entry on oeis.org

0, 3, 5, 11, 17, 24, 30, 39, 42, 45, 57, 72, 60, 84, 90, 117, 123, 144, 120, 105, 162, 150, 180, 237, 165, 264, 288, 195, 231, 240, 210, 285, 255, 336, 396, 378, 438, 357, 399, 345, 519, 315, 504, 465, 390, 480, 435, 462, 450, 567, 717, 420, 495, 651
Offset: 0

Views

Author

N. J. A. Sloane, Jun 14 2015

Keywords

Comments

Up to a(14) also indices of records in A002375, number of ways to write 2n as sum of two odd primes. - M. F. Hasler, Aug 21 2017

Crossrefs

Programs

  • Maple
    g:= add(x^ithprime(i),i=2..1000):
    G:= series((g^2+add(x^(2*ithprime(i)),i=2..1000))/2,x,ithprime(1001)+3):
    A[0]:= 0:
    for k from 1 to (ithprime(1001)+1)/2 do
      m:= coeff(G,x,2*k);
      if not assigned(A[m]) then A[m]:= k fi;
    od:
    for m from 1 while assigned(A[m]) do od:
    seq(A[i],i=0..m-1); # Robert Israel, Aug 21 2017
  • Mathematica
    With[{s = Array[Count[Select[IntegerPartitions[2 #, 2], Length@ # == 2 &], p_ /; AllTrue[p, And[PrimeQ@ #, OddQ@ #] &]] &, 10^3]}, Table[FirstPosition[s, n][[1]] /. 1 -> 0, {n, 0, 53}]] (* Michael De Vlieger, Aug 21 2017 *)

Extensions

Edited by M. F. Hasler, Aug 21 2017
Edited by Robert Israel, Aug 21 2017

A332981 Smallest semiprime m = p*q such that the sum s = p + q can be expressed as an unordered sum of two primes in exactly n ways.

Original entry on oeis.org

4, 21, 57, 93, 183, 291, 327, 395, 501, 545, 695, 791, 815, 831, 1145, 1205, 1415, 1631, 1461, 1745, 1941, 1865, 2661, 2315, 2615, 2855, 2495, 2285, 3665, 2705, 2721, 3521, 3561, 3351, 3755, 4341, 3545, 4701, 4265, 4881, 3981, 4821, 5601, 5255, 6671, 6041, 4595
Offset: 1

Views

Author

Michel Lagneau, Mar 05 2020

Keywords

Comments

The unique square and even term of the sequence is a(1) = 4.
For n = 1, the sequence of semiprimes having a unique decomposition as the sum of two primes begins with 4, 6, 9, 10, 14, 15, 22, 26, 34, 35, 38, 46, 58, 62, ... containing the even semiprimes (A100484).
We observe a majority of terms where a(n) == 5 (mod 10).

Examples

			a(11) = 695 because 695 = 5*139 and the sum 5 + 139 = 144 = 5+139 = 7+137 = 13+131 = 17+127 = 31+113 = 37+107 = 41+103 = 43+101 = 47+97 = 61+83 = 71+73. There are exactly 11 decompositions of 144 into an unordered sum of two primes.
		

Crossrefs

Programs

  • Maple
    with(numtheory):
    for n from 1 to 50 do:
    ii:=0:
    for k from 2 to 10^8 while(ii=0) do:
    x:=factorset(k):it:=0:
    if bigomega(k) = 2
      then
       s:=x[1]+k/x[1]:
        for m from 1 to s/2 do:
         if isprime(m) and isprime(s-m)
          then
           it:=it+1:
           else fi:
         od:
         if it = n
         then
          ii:=1: printf(`%d, `,k):
         else fi:
         fi:
        od:
        od:
  • PARI
    nbp(k) = {my(nb = 0); forprime(p=2, k\2, if (isprime(k-p), nb++););nb;}
    a(n) = {forcomposite(k=1, oo, if (bigomega(k)==2, my(x=factor(k)[1,1]); if (nbp(x+k/x)==n, return(k));););} \\ Michel Marcus, Apr 26 2020

A354462 a(n) is the least number k such that there are exactly n pairs (p,q) of primes with p

Original entry on oeis.org

1, 4, 15, 315, 420, 825, 2310, 3150, 1785, 8925, 6090, 6405, 8610, 24990, 19305, 12705, 14175, 15015, 18165, 19635, 24255, 48510, 63525, 33915, 48195, 54285, 35490, 50505, 55650, 69615, 71610, 80850, 78540, 103740, 39270, 157920, 60060, 65835, 90090, 147840, 120120, 183645
Offset: 0

Views

Author

J. M. Bergot and Robert Israel, May 31 2022

Keywords

Comments

a(n) is the least solution to A354449(k) = n.

Examples

			a(2) = 15 because for k = 15 there are two such pairs, (7,23) and (13,17): 2*15+7 = 37, 2*15+23 = 53, 7*23-2*15 = 131, 7*23+2*15 = 191, 2*15+13 = 43, 2*15+17 = 47, 13*17-2*15 = 191 and 13*17+2*15 = 251 are all prime; and 15 is the least k that works.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local count,p,q;
      p:= 2*n-1 ; count:= 0;
      do
        p:= prevprime(p);
        if p < n then return count fi;
        q:= 2*n-p;
        if isprime(q) and isprime(2*n+q) and isprime(2*n+p) and isprime(p*q-2*n) and isprime(p*q+2*n) then count:=count+1 fi;
      od
    end proc:
    f(1):= 0: f(2):= 0:
    V:= Array(0..12): count:= 0:
    for n from 1 while count < 13 do
      v:= f(n);
      if v <= 12 and V[v] = 0 then
      count:= count+1; V[v]:= n
    fi
    od:
    convert(V,list);
  • Mathematica
    f[n_] := Sum[If[AllTrue[{k, 2*n - k, 2*n + k, 4*n - k, k*(2 n - k) - 2*n, k*(2 n - k) + 2*n}, PrimeQ], 1, 0], {k, 1, n}]; seq[len_, max_] := Module[{s = Table[0, {len}], n = 1, c = 0, i}, While[c < len && n <= max, i = f[n] + 1; If[i<= len && s[[i]] == 0, c++; s[[i]] = n]; n++]; s]; seq[13, 10^4] (* Amiram Eldar, May 31 2022 *)
  • PARI
    a354449(n) = my(x=2*n, i=0); forprime(q=1, x, forprime(p=1, q-1, if(p+q==x && ispseudoprime(x+p) && ispseudoprime(x+q) && ispseudoprime(p*q-x) && ispseudoprime(p*q+x), i++))); i
    a(n) = for(k=1, oo, if(a354449(k)==n, return(k))) \\ Felix Fröhlich, May 31 2022
    
  • PARI
    upto(n) = {n*=2; v = vector(n\2); forprime(p = 3, n, forprime(q = 3, min(p, n-p), k2 = p+q; if(ispseudoprime(k2+p) && ispseudoprime(k2+q) && ispseudoprime(p*q-k2) && ispseudoprime(p*q+k2), v[k2\2]++ ) ) ); res = [0]; for(i = 1, #v, if(v[i]+1 > #res, res = concat(res, vector(v[i]+1-#res)) ); if(res[v[i]+1] == 0, res[v[i]+1] = i ) ); res } \\ David A. Corneth, Jun 01 2022

Extensions

a(13)-a(32) from Amiram Eldar, May 31 2022
More terms from David A. Corneth, Jun 01 2022
Showing 1-4 of 4 results.