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

A087054 Primes of the form pq + qr + rp where p, q and r are distinct primes.

Original entry on oeis.org

31, 41, 59, 61, 71, 101, 103, 113, 131, 151, 167, 191, 199, 211, 227, 239, 241, 251, 263, 269, 271, 281, 293, 311, 331, 347, 359, 383, 401, 419, 421, 431, 439, 461, 467, 479, 487, 491, 503, 521, 541, 563, 571, 587, 599, 607, 617, 631, 641, 647, 653, 661, 691
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 07 2003

Keywords

Examples

			A003415(2*3*19)=2*3+3*19+19*2=101=A000040(26), therefore 101 is a term (but also A003415(2*5*13)=2*5+5*13+13*2=101).
		

Crossrefs

Cf. A087053 (numbers of the form pq+qr+rp).
Cf. A189759 (p*q*r for primes of this form).

Programs

  • Mathematica
    sumProd[p_,q_,r_]:=p*q+p*r+q*r; pqrPrimes[nn_] := Module[{p=Prime[Range[PrimePi[(nn-6)/5]+1]],i,j,k,n}, Union[Reap[i=0; While[i++; sumProd[p[[i]],p[[i+1]],p[[i+2]]] <= nn, j=i; While[j++; sumProd[p[[i]],p[[j]],p[[j+1]]] <= nn, k=j; While[k++; n=sumProd[p[[i]],p[[j]],p[[k]]]; n <= nn, If[PrimeQ[n], Sow[n]]]]]][[2,1]]]]; pqrPrimes[1000] (* T. D. Noe, Apr 27 2011 *)
    nn=100;Take[Select[Union[Total[Times@@@Subsets[#,{2}]]&/@Subsets[ Prime[ Range[ nn]],{3}]],PrimeQ],nn] (* Harvey P. Dale, Jan 08 2013 *)
  • PARI
    list(lim)=my(v=List()); forprime(r=5, (lim-6)\5, forprime(q=3, min((lim-2*r)\(r+2), r-2), my(S=q+r, P=q*r); forprime(p=2, min((lim-P)\S, q-1), isprime(p*S+P) && listput(v,p*S+P)))); Set(v) \\ Charles R Greathouse IV, Feb 26 2014
    
  • PARI
    is(n)=forprime(r=(sqrtint(3*n-3)+5)\3, (n-6)\5, forprime(q= sqrtint(r^2+n)-r+1, min((n-2*r)\(r+2), r-2), if((n-q*r)%(q+r)==0 && isprime((n-q*r)/(q+r)), return(isprime(n))))); 0 \\ Charles R Greathouse IV, Feb 26 2014

Extensions

Corrected by T. D. Noe, Apr 27 2011

A238397 Numbers of the form pq + qr + rp where p, q and r are distinct primes (sorted sequence without duplicates).

Original entry on oeis.org

31, 41, 59, 61, 71, 87, 91, 101, 103, 113, 119, 121, 129, 131, 143, 151, 161, 167, 171, 185, 191, 199, 211, 213, 215, 221, 227, 239, 241, 243, 247, 251, 263, 269, 271, 275, 281, 293, 297, 299, 301, 311, 321, 327, 331, 339, 341, 343, 347, 355
Offset: 1

Views

Author

Jean-François Alcover, Feb 26 2014

Keywords

Comments

Numbers of the form e2(p, q, r) for distinct primes p, q, r, where e2 is the elementary symmetric polynomial of degree 2. Other sequences are obtained with different numbers of distinct primes and degrees: A000040 for 1 prime, A038609 and A006881 for 2 primes, A124867, this sequence, and A007304 for 3 primes. The 4-prime sequences are not presently in the OEIS with the exception of A046386. - Charles R Greathouse IV, Feb 26 2014

Examples

			71 = 3*5 + 5*7 + 7*3 = 2*3 + 3*13 + 13*2 is in the sequence (only once, though 2 solutions exist).
		

Crossrefs

Programs

  • Mathematica
    terms = 50; dm (* initial number of primes *) = 10; f[p_, q_, r_] := p*q + q*r + r*p; Clear[A238397]; A238397[m_] := A238397[m] = Take[u = Union[f @@@ Subsets[Prime /@ Range[m], {3}]], Min[Length[u], terms]]; A238397[dm]; A238397[m = 2*dm]; While[Print["m = ", m]; A238397[m] != A238397[m - dm], m = m + dm]; A238397[m]
  • PARI
    is(n)=forprime(r=(sqrtint(3*n-3)+5)\3, (n-6)\5, forprime(q= sqrtint(r^2+n)-r+1, min((n-2*r)\(r+2), r-2), if((n-q*r)%(q+r)==0 && isprime((n-q*r)/(q+r)), return(1)))); 0 \\ Charles R Greathouse IV, Feb 26 2014
    
  • PARI
    list(n)=my(v=List()); forprime(r=5, (n-6)\5, forprime(q=3, min((n-2*r)\(r+2), r-2), my(S=q+r, P=q*r); forprime(p=2, min((n-P)\S, q-1), listput(v, p*S+P)))); Set(v) \\ Charles R Greathouse IV, Feb 26 2014

A238403 Number of ways a number can be decomposed as a sum of the form pq + qr + rp where p < q < r are distinct primes.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

Jean-François Alcover, Feb 26 2014

Keywords

Comments

The average value of a(n) is >> sqrt(n)/log^3 n. - Charles R Greathouse IV, Feb 26 2014

Examples

			71 = 3*5 + 5*7 + 7*3 = 2*3 + 3*13 + 13*2, therefore a(71) = 2.
		

Crossrefs

Programs

  • Mathematica
    r[n_, p_] := Reduce[p < q < r && p*q+q*r+r*p == n, {q, r}, Primes]; a[n_] := (For[cnt = 0; p = 2, p <= Ceiling[(n-6)/5], p = NextPrime[p], rnp = r[n, p]; If[rnp =!= False, Which[rnp[[0]] === And, Print["n = ", n, " ", {p, q, r} /. ToRules[rnp]]; cnt++, rnp[[0]] === Or, Print["n = ", n, " ", {p, q, r} /. {ToRules[rnp]}]; cnt += Length[rnp], True, Print["error: n = ", n, " ", rnp]]]]; cnt); Table[a[n], {n, 1, 100}]
  • PARI
    list(n)=my(v=vector(n)); forprime(r=5,(n-6)\5, forprime(q=3, min((n-2*r)\(r+2),r-2), my(S=q+r,P=q*r); forprime(p=2,min((n-P)\S,q-1), v[p*S+P]++))); v \\ Charles R Greathouse IV, Feb 26 2014
    
  • PARI
    a(n)=my(s);forprime(r=(sqrtint(3*n-3)+5)\3,(n-6)\5, forprime(q= sqrtint(r^2+n)-r+1,min((n-2*r)\(r+2),r-2),if((n-q*r)%(q+r)==0 && isprime((n-q*r)/(q+r)),s++)));s \\ Charles R Greathouse IV, Feb 26 2014

A237992 Numbers which can be decomposed as p*q + q*r + r*p (where p < q < r are distinct primes) in more ways than any smaller number.

Original entry on oeis.org

31, 71, 151, 191, 311, 1031, 1991, 3191, 5351, 5591, 10391, 15791, 17111, 27191, 31391, 35591, 42311, 50951, 70391, 93551, 107159, 117911, 119831, 126551, 166871, 180311, 191831, 216191, 255191, 259871, 327071, 366791, 435431, 465911, 514751, 576551, 599231, 631991
Offset: 1

Views

Author

Keywords

Comments

Records in A238403.

Examples

			71 = 3*5 + 3*7 + 5*7 = 2*3 + 2*13 + 3*13 can be written in two ways, while smaller numbers can be written in at most one way.
		

Crossrefs

Programs

  • PARI
    do(n)=my(v=vectorsmall(n),r); forprime(r=5,(n-6)\5, forprime(q=3, min((n-2*r)\(r+2),r-2), my(S=q+r,P=q*r); forprime(p=2,min((n-P)\S,q-1), v[p*S+P]++))); for(i=1,#v,if(v[i]>r,r=v[i];print1(i", ")))

A356457 a(n) is the least number that can be written in exactly n ways as p*q + q*r + p*r where (p,q,r) is an unordered triple of distinct primes.

Original entry on oeis.org

1, 31, 71, 151, 191, 491, 671, 887, 311, 1151, 1391, 1751, 1031, 2711, 2831, 3911, 1991, 3191, 5351, 9551, 7031, 20951, 8951, 8711, 10631, 5591, 15431, 10391, 15791, 28031, 20471, 17111, 48191, 27191, 31391, 39191, 52631, 35591, 42311, 61871, 50951, 92231, 70391, 108071, 99431, 103991, 96071
Offset: 0

Views

Author

J. M. Bergot and Robert Israel, Aug 07 2022

Keywords

Comments

Empirical observation: It appears that the majority of the members of this sequence end in 1, and nearly all the rest end in 9.
Conjecture: a(n) = A003415(A007304(k)) and a(n) is the least number where at least n solutions for k exist. - Thomas Scheuerle, Aug 08 2022

Examples

			a(3) = 151 because 151 is the first number that can be written in exactly 3 ways: 151 = 3*7 + 3*13 + 7*13 = 3*5 + 3*17 + 5*17 = 2*3 + 2*29 + 3*29.
		

Crossrefs

Programs

  • Maple
    M:= 10^5: # to get terms before the first term > M
    V:= Vector(M): p:= 1:
    do
    p:= nextprime(p);
    if 5*p+6 > M then break fi;
    q:= 1;
    do
        q:= nextprime(q);
      if q = p or p*q + 2*(p+q) > M then break fi;
      r:= 1;
      do
        r:= nextprime(r);
        if r = q then break fi;
        v:= p*q + p*r + q*r;
        if v > M then break fi;
        V[v]:= V[v]+1;
    od od od:
    m:= max(V):
    W:= Array(0..m):
    for i from 1 to M do
    if W[V[i]] = 0 then W[V[i]]:= i fi
    od:
    if member(0,W,'k') then m:= k-1 fi:
    convert(W[0..m],list);

A238404 Number of ways a prime from A087054 can be decomposed as a sum of the form p*q+q*r+r*p where p, q and r are distinct primes (p < q < r).

Original entry on oeis.org

1, 1, 1, 1, 2, 2, 1, 1, 2, 3, 3, 4, 1, 2, 1, 1, 1, 1, 3, 2, 2, 1, 1, 8, 1, 1, 2, 3, 2, 1, 1, 3, 2, 1, 1, 3, 1, 5, 4, 3, 1, 3, 1, 1, 4, 1, 1, 3, 2, 4, 1, 1, 3, 1, 1, 2, 1, 3, 2, 2, 1, 1, 3, 2, 5, 1, 1, 7, 8, 1, 3, 4, 1, 6, 3, 2, 12, 1, 1, 1, 1, 5, 2, 1, 9, 1, 1, 1, 2, 1, 5, 1, 2, 1, 3, 3, 1, 2, 7, 1
Offset: 1

Views

Author

Jean-François Alcover, Feb 26 2014

Keywords

Examples

			A087054(5) = 71 = 3*5 + 5*7 + 7*3 = 2*3 + 3*13 + 13*2, therefore a(5) = 2.
		

Crossrefs

Programs

  • Mathematica
    nn = 100; A087854 = Take[Select[ Union[Total[Times @@@ Subsets[#, {2}]] & /@ Subsets[Prime[Range[nn]], {3}]], PrimeQ], nn]; r[n_, p_] := Reduce[p < q < r && p*q+q*r+r*p == n, {q, r}, Primes]; a[n_] := (For[cnt = 0; p = 2, p <= Ceiling[(n-6)/5], p = NextPrime[p], rnp = r[n, p]; If[rnp =!= False, Which[rnp[[0]] === And, Print["n = ", n, " ", {p, q, r} /. ToRules[rnp]]; cnt++, rnp[[0]] === Or, Print["n = ", n, " ", {p, q, r} /. {ToRules[rnp]}]; cnt += Length[rnp], True, Print["error: n = ", n, " ", rnp]]]]; cnt); Reap[Do[ap = a[p]; If[ap > 0, Sow[ap]], {p, A087854}]][[2, 1]] (* after Harvey P. Dale *)
Showing 1-6 of 6 results.