ZCubes/Twin Primes & Bruns Theorem

From ZCubes Wiki
Jump to: navigation, search

Twin Primes & Bruns Theorem

Twin primes are prime numbers separated by 2. Viggo Bruns theorem states that sum of reciprocals of twin primes is convergent. This video demonstrates how to test this theorem, using ZCubes. You will observe that the computation is simple and easy in ZCubes, as it takes only 4 lines of code.


Twin Primes & Bruns Theorem



--> displays first 1000 prime numbers


--> above code filters the first 1000 primes to check if the difference between two prime numbers is '2' and displays the list of twin primes as (3 5), (5,7), (11,13) etc This list is stored as a table named 'ps'. Using the below code statement, this table is further used to map it to the reciprocals of the twin primes and add them.


<< Learn ZCubes
© Copyright 1996-2020, ZCubes, Inc.