Post Reply 
Goldbach Conjecture 
03-16-2015, 01:10 PM
Post: #2
RE:   former rainy day
I did not know about Goldbachs conjecture. Thanks for sharing the idea. This is DrDs frame with some changes. Have not found out yet how to plot with the prime so this has to wait. [/quote]
Code:

EXPORT Goldbach(n)
//  Goldbach conjecture (June 7, 1742):  Positive even integers greater than 2 are the sum of two prime numbers.
BEGIN
  local a:=2, maxn:= n/2, pp:={};         
  print();
         
// Make list of prime number pairs
 REPEAT
    IFTE(isPrime(n-a), pp:=concat(pp,{{a,n-a}}))));   
    a:=nextprime(a);
 UNTIL a>maxn;  //end calc
 
  print(pp);  // prime pairs
  print("Goldbach Partitions = " + SIZE(pp));   //number of pairs 
END;  // Ends program
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Goldbach Conjecture  - DrD - 03-15-2015, 04:45 PM
RE:   former rainy day - Teresa - 03-16-2015 01:10 PM
RE: Goldbach Conjecture  - DrD - 03-18-2015, 04:07 PM
RE: Goldbach Conjecture  - DrD - 03-22-2015, 10:32 AM



User(s) browsing this thread: 1 Guest(s)