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.

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

This page as a plain text file.
%I A087053 #21 Aug 30 2024 19:27:39
%S A087053 31,41,61,59,71,91,71,87,101,101,121,113,103,129,151,131,161,143,119,
%T A087053 191,171,131,167,211,151,221,185,151,241,167,191,213,227,271,221,199,
%U A087053 301,191,311,269,243,167,211,341,275,297,269,361,215,311,293,247,371
%N A087053 Numbers of the form pq + qr + rp where p, q and r are distinct primes, with multiplicity.
%C A087053 Arithmetic derivative of numbers having exactly three primes that are distinct: a(n) = A003415(A007304(n)).
%o A087053 (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
%o A087053 (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
%o A087053 (Python)
%o A087053 from math import isqrt
%o A087053 from sympy import primepi, primerange, integer_nthroot, primefactors
%o A087053 def A087053(n):
%o A087053     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)))
%o A087053     def bisection(f,kmin=0,kmax=1):
%o A087053         while f(kmax) > kmax: kmax <<= 1
%o A087053         while kmax-kmin > 1:
%o A087053             kmid = kmax+kmin>>1
%o A087053             if f(kmid) <= kmid:
%o A087053                 kmax = kmid
%o A087053             else:
%o A087053                 kmin = kmid
%o A087053         return kmax
%o A087053     return (p:=primefactors(bisection(f)))[0]*(p[1]+p[2])+p[1]*p[2] # _Chai Wah Wu_, Aug 30 2024
%Y A087053 Cf. A087054, A238397.
%K A087053 nonn
%O A087053 1,1
%A A087053 _Reinhard Zumkeller_, Aug 07 2003