Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

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

Search the Archive

RE: Prime Puzzle with Mathematica

  • To: mathgroup at smc.vnet.net
  • Subject: [mg92700] RE: [mg92680] Prime Puzzle with Mathematica
  • From: "Harvey P. Dale" <hpd1 at nyu.edu>
  • Date: Sat, 11 Oct 2008 06:41:45 -0400 (EDT)
  • References: <200810100835.EAA07106@smc.vnet.net>

Amzoti:


okQ[l_]:=Module[{l2=Subsets[l,{2}]},And@@PrimeQ[Mean[#]&/@l2]]

Select[Select[Subsets[Prime[Range[PrimePi[11],PrimePi[100]]],{3}],PrimeQ
[Mean[#]]&],okQ]

This yields: {{11,47,71}}

Best,

Harvey



-----Original Message-----
From: amzoti [mailto:amzoti at gmail.com]
Sent: Friday, October 10, 2008 4:35 AM
To: mathgroup at smc.vnet.net
Subject: [mg92700] [mg92680] Prime Puzzle with Mathematica



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



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