All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Just Math
Prime Time Revisited (Posted on 2004-10-22) Difficulty: 2 of 5
Do there exist three 2-digit primes such that:
  • Any two of the three, averaged, produce another prime, and
  • The average of all three is prime

See The Solution Submitted by SilverKnight    
Rating: 3.0000 (8 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution UBASIC program | Comment 8 of 17 |
(In reply to Sieve of Eratosthenes (solution) by Penny)

  5   dim Pr(25)
 10   P=9
 20   while P<100
 30      P=nxtprm(P)
 40      if P<100 then:I=I+1:Pr(I)=P
 50   wend:print
 60   NumPr=I
200   for I=1 to NumPr-2
210    for J=I+1 to NumPr-1
212    Av1=(Pr(I)+Pr(J))/2
215    if nxtprm(Av1-1)=Av1 then
220    :for K=J+1 to NumPr
222     :Av2=(Pr(I)+Pr(K))/2:Av3=(Pr(J)+Pr(K))/2
225     :if nxtprm(Av2-1)=Av2 and nxtprm(Av3-1)=Av3 then
230     :Av=(Pr(I)+Pr(J)+Pr(K))/3
240     :if Av=int(Av) then
250       :if nxtprm(Av-1)=Av then print Pr(I),Pr(J),Pr(K),Av:endif
255      :endif
257     :endif
260    :next
270    next
280   next

finds

11      47      71      43.0 (the latter being the average)


  Posted by Charlie on 2004-10-22 15:40:33
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (3)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information