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.

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

A087053 Numbers of the form pq + qr + rp where p, q and r are distinct primes, with multiplicity.

Original entry on oeis.org

31, 41, 61, 59, 71, 91, 71, 87, 101, 101, 121, 113, 103, 129, 151, 131, 161, 143, 119, 191, 171, 131, 167, 211, 151, 221, 185, 151, 241, 167, 191, 213, 227, 271, 221, 199, 301, 191, 311, 269, 243, 167, 211, 341, 275, 297, 269, 361, 215, 311, 293, 247, 371
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 07 2003

Keywords

Comments

Arithmetic derivative of numbers having exactly three primes that are distinct: a(n) = A003415(A007304(n)).

Crossrefs

Programs

  • 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
    
  • Python
    from math import isqrt
    from sympy import primepi, primerange, integer_nthroot, primefactors
    def A087053(n):
        def f(x): return int(n+x-sum(primepi(x//(k*m))-b for a,k in enumerate(primerange(integer_nthroot(x,3)[0]+1),1) for b,m in enumerate(primerange(k+1,isqrt(x//k)+1),a+1)))
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        return (p:=primefactors(bisection(f)))[0]*(p[1]+p[2])+p[1]*p[2] # Chai Wah Wu, Aug 30 2024

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

A189759 Numbers pqr such that pq + pr + qr is prime, where p, q, and r are primes.

Original entry on oeis.org

30, 42, 66, 70, 78, 105, 114, 130, 154, 165, 174, 182, 222, 231, 238, 246, 255, 273, 282, 285, 286, 310, 318, 345, 357, 366, 370, 385, 399, 418, 430, 434, 442, 455, 465, 474, 483, 494, 498, 518, 555, 561, 574, 582, 595, 602, 609, 618, 642, 645, 651, 663, 665
Offset: 1

Views

Author

T. D. Noe, Apr 27 2011

Keywords

Comments

The number pq+pr+qr is prime only if p, q, and r are distinct. The primes of form pq+pr+qr are in A087054. A prime may have multiple representations as pq+pr+qr; for example, 2*3*13 and 3*5*7 both produce the prime 71.
As mentioned by Ufnarovski and Ahlander, if pq+pr+qr is prime, then the arithmetic derivative (A003415) of pqr is that prime. They conjecture that this sequence and A087054 are infinite.

Crossrefs

Programs

  • Mathematica
    pqr[nn_] := Module[{p=Prime[Range[PrimePi[nn/6]+1]],i,j,k,n,prod}, Sort[Reap[i=0; While[i++; p[[i]]p[[i+1]]p[[i+2]] <= nn, j=i; While[j++; p[[i]]p[[j]]p[[j+1]] <= nn, k=j; While[k++; prod=p[[i]]p[[j]]p[[k]]; prod <= nn, n=p[[i]]p[[j]]+p[[i]]p[[k]]+p[[j]]p[[k]]; If[PrimeQ[n], Sow[prod]]]]]][[2,1]]]]; pqr[1000]
    Take[Union[Times@@@Select[Subsets[Prime[Range[30]],{3}],PrimeQ[ Total[ Times@@@Subsets[#,{2}]]]&]],60](* Harvey P. Dale, Dec 29 2011 *)

A227680 Numbers whose sum of semiprime divisors is a prime number.

Original entry on oeis.org

30, 36, 42, 66, 70, 72, 78, 105, 108, 114, 130, 144, 154, 165, 174, 182, 196, 210, 216, 222, 231, 238, 246, 255, 273, 282, 285, 286, 288, 310, 318, 324, 345, 357, 366, 370, 385, 392, 399, 418, 430, 432, 434, 441, 442, 455, 462, 465, 474, 483, 494, 498, 518
Offset: 1

Views

Author

Michel Lagneau, Jul 19 2013

Keywords

Comments

There exists a subsequence of infinite squares {36, 144, 196, 324, 441, 576, 676, 784, 1089, 1225, 1296, 1764,...} because the numbers of the form n = (p*q)^2 with p and q primes are in the sequence if p^2 + p*q + q^2 is prime (subsequence of A007645), and the numbers p^2, p*q and q^2 are the three possible semiprime divisors of n. This numbers of the sequence are 6^2, 14^2, 21^2, 26^2, 33^2, 35^2, 51^2, 69^2,...
The numbers of the form n = (p^a*q^v)^2 are also in the sequence => the sequence is infinite.
There exists a subsequence of numbers having three distinct prime divisors p, q and r such that p*q+q*r+r*p is prime (see A087054). This numbers are 30, 42, 66, 70, 78, 105, 114, ...

Examples

			30 is in the sequence because the semiprime divisors of 30 are 2*3, 2*5 and 3*5 and the sum 6+10+15 = 31 is a prime number.
		

Crossrefs

Cf. A007645 (primes of the form x^2 + xy + y^2).
Cf. A087054 (primes of the form p*q + q*r + r*p where p, q and r are distinct prime numbers).

Programs

  • Maple
    with(numtheory):for n from 2 to 600 do:x:=divisors(n):n1:=nops(x): y:=factorset(n):n2:=nops(y):s1:=0:s2:=0:for i from 1 to n1 do: if bigomega(x[i])=2 then s1:=s1+x[i]:else fi:od: s2:=sum('y[i]', 'i'=1..n2):if type(s1,prime)=true then printf(`%d, `,n):else fi:od:
  • Mathematica
    semipSigma[n_] := DivisorSum[n, # &, PrimeOmega[#] == 2 &]; Select[Range[500], PrimeQ @ semipSigma[#] &] (* Amiram Eldar, May 10 2020 *)

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