Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

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

Search the Archive

Re: Prime Puzzle with Mathematica [CORRECTION]

  • To: mathgroup at smc.vnet.net
  • Subject: [mg92712] Re: [mg92680] Prime Puzzle with Mathematica [CORRECTION]
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Sat, 11 Oct 2008 06:43:59 -0400 (EDT)
  • Reply-to: hanlonr at cox.net

This can be written more compactly as

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


Bob Hanlon

---- Bob Hanlon <hanlonr at cox.net> wrote: 

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

{11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97}

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

{{11, 47, 71}}


Bob Hanlon

---- amzoti <amzoti at gmail.com> 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

Thanks!

~A


--

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