Last active
May 15, 2022 22:36
-
-
Save ThomRoman/72f6cfdde6d02a50ced8f4dd9d6bfb0b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import random | |
listacubos = [] | |
primos = 0 | |
repeticiones = {} | |
import math | |
def esprimo(num): | |
for n in range(2,int(num**0.5)+1): | |
if num%n==0: | |
return False | |
return True | |
print("calculando ...") | |
for i in range(0,500001): | |
aleatorio = random.randint(0, sys.maxsize) | |
print("%s %s" % (i, aleatorio)) | |
if aleatorio in repeticiones : | |
repeticiones[aleatorio] += 1 | |
else: | |
repeticiones[aleatorio] = 1 | |
if aleatorio % ( aleatorio**(1/3) ) == 0 : | |
listacubos.append(aletorio) | |
print("lista de todos los que son cubos de algún numero natural") | |
print("\n",listacubos) | |
print("\nse tuvo que generar para obtener 200 números primos.") | |
print(primos) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment