A238397 Numbers of the form pq + qr + rp where p, q and r are distinct primes (sorted sequence without duplicates).
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
Keywords
Examples
71 = 3*5 + 5*7 + 7*3 = 2*3 + 3*13 + 13*2 is in the sequence (only once, though 2 solutions exist).
Links
- Jean-François Alcover, Table of n, a(n) for n = 1..1000
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
Comments