synchronization flowchart for finding prime numbers