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

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

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", ")))

A238503 Numbers of the form pq + pr + ps + qr + qs + rs where p, q, r, and s are distinct primes.

Original entry on oeis.org

101, 141, 161, 173, 197, 201, 213, 221, 236, 241, 245, 261, 266, 269, 297, 317, 321, 325, 326, 333, 341, 350, 356, 365, 373, 377, 381, 389, 393, 401, 404, 413, 416, 426, 429, 441, 453, 461, 464, 465, 466, 476, 481, 485, 488, 493, 501, 505, 506
Offset: 1

Views

Author

Keywords

Comments

Numbers of the form e2(p, q, r, s) for distinct primes p, q, r, s 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, A238397, and A007304 for 3 primes.
What is the density of this sequence, and is it less than 1? There are 701917 terms below a million and 7042080 below 10^7.
There are 70307093 terms below 10^8. - Charles R Greathouse IV, Jun 14 2017

Examples

			101 = 2*3 + 2*5 + 2*7 + 3*5 + 3*7 + 5*7.
		

Crossrefs

Cf. A238397.

Programs

  • Mathematica
    pqrs[{p_,q_,r_,s_}]:=Total[Times@@@Subsets[{p,q,r,s},{2}]]; Take[ Flatten[ pqrs/@Subsets[Prime[Range[20]],{4}]]//Union,50] (* Harvey P. Dale, Jan 17 2021 *)
  • PARI
    list(n)=my(v=List()); forprime(s=7,(n-31)\10,forprime(r=5, min((n-6-5*s)\(s+5),s-2), forprime(q=3, min((n-2*r-2*s-r*s)\(s+r+2), r-2), my(S=q+r+s, P=q*r+r*s+q*s); forprime(p=2, min((n-P)\S, q-1), listput(v, p*S+P))))); Set(v)
    
  • PARI
    list(n)=my(v=vectorsmall(n),u=List()); forprime(s=7,(n-31)\10,forprime(r=5, min((n-6-5*s)\(s+5),s-2), forprime(q=3, min((n-2*r-2*s-r*s)\(s+r+2), r-2), my(S=q+r+s, P=q*r+r*s+q*s); forprime(p=2, min((n-P)\S, q-1), v[p*S+P]=1)))); for(i=1,n,if(v[i],listput(u,i))); Vec(u)
Showing 1-3 of 3 results.