4 Topics

Member Avatar for
Member Avatar for TrustyTony

Finding efficiently primes, whose begining numbers are also primes. See the thread http://www.daniweb.com/software-development/cpp/threads/425821/prime-number-c in C++ forum for discussion on topic.

1
270
Member Avatar for hovestar

I made a program to find primes, but it can't find any prime less that 7(e.g. 2, 3, 5) any ideas? [CODE]import math from math import sqrt x = 1 y = raw_input("What number do you wish to find all the primes below? ") y = int(y) while x < …

Member Avatar for TrustyTony
0
162
Member Avatar for TrustyTony

This I did also after 'spying' discussions in other forum. Of course you would use sieve prime generation for bigger numbers, but I proved other simple way for a change. Slightly more advanced primes list generator would use primes % 6 in (1,5) property: [CODE]def primes(n): """ primitive non-sieve prime …

Member Avatar for TrustyTony
0
657
Member Avatar for Thisisnotanid

Hi all, I wrote code to list primes that are in a given "radius" of an even number. For example, 6 - 1 = 5 and 6 + 1 = 7, 14 - 3 = 11 and 14 + 3 = 17, etc. I used Euler's sieve to obtain the …

0
99

The End.