MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Prime Puzzle with Mathematica [CORRECTION]

This can be written more compactly as

Select[Subsets[p, {3}], And @@ PrimeQ /@ Mean /@ Subsets[#, {2, 3}] &]

Bob Hanlon

---- Bob Hanlon <hanlonr at> wrote: 

p = Table[Prime[i], {i, 5, 25}]


Select[Subsets[p, {3}], 
 And @@ (PrimeQ /@ (Mean /@ Drop[Subsets[#], 4])) &]

{{11, 47, 71}}

Bob Hanlon

---- amzoti <amzoti at> wrote: 

Hi All,

trying to find an efficient way to this in Mathematica.

I found the answer - but it was a manual list manipulation - and it
was ugly!

Any suggestions?

3 Nice Primes:

Find three 2-digit prime numbers such that:

    * The average of any two of the three is a prime number, and
    * The average of all three is also a prime number




Bob Hanlon


Bob Hanlon

  • Prev by Date: RE: Prime Puzzle with Mathematica
  • Next by Date: RE: Prime Puzzle with Mathematica
  • Previous by thread: Re: Inconsistent syntax for Row and Column?
  • Next by thread: Re: Square Brackets