Ask Your Question

# Revision history [back]

### Common primes............

I am trying to create a visualization of how common it is for a number to be prime. I am fairly new with the program and was hoping to get some assistant with any veteran users. My code I wrote is:

def com_primes(k):
prime_list = []
for n in range(1,k+1):
for m in range(1,n+1):
if Integer(n)/Integer(n) & Integer(n)/1 in ZZ:
if is_prime(m):
prime_list.append((n,m))
return point(prime_divisor_list)


but the code is obviously wrong. If anyone could help me, that would be much appreciated.

 2 retagged vdelecroix 7397 ●19 ●81 ●164 http://www.labri.fr/pe...

### Common primes............

I am trying to create a visualization of how common it is for a number to be prime. I am fairly new with the program and was hoping to get some assistant with any veteran users. My code I wrote is:

def com_primes(k):
prime_list = []
for n in range(1,k+1):
for m in range(1,n+1):
if Integer(n)/Integer(n) & Integer(n)/1 in ZZ:
if is_prime(m):
prime_list.append((n,m))
return point(prime_divisor_list)


but the code is obviously wrong. If anyone could help me, that would be much appreciated.

 3 better title vdelecroix 7397 ●19 ●81 ●164 http://www.labri.fr/pe...

### Common primes............Plot with prime numbers

I am trying to create a visualization of how common it is for a number to be prime. I am fairly new with the program and was hoping to get some assistant with any veteran users. My code I wrote is:

def com_primes(k):
prime_list = []
for n in range(1,k+1):
for m in range(1,n+1):
if Integer(n)/Integer(n) & Integer(n)/1 in ZZ:
if is_prime(m):
prime_list.append((n,m))
return point(prime_divisor_list)


but the code is obviously wrong. If anyone could help me, that would be much appreciated.