Created
August 20, 2020 01:36
-
-
Save scholtes/fc1f4a6b1908c90c8278a54973c17f51 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
from sympy import prime | |
from math import tan, pi | |
from random import random | |
def chug_primes(): | |
max = 0 | |
for i in range(1,1000000000000): | |
p = prime(i) | |
v = tan(p)/p | |
if v > max: | |
max = v | |
print(f"{i}: {p} <-> {v}") | |
def chug_integers(): | |
max = 0 | |
for i in range(1,1000000000000): | |
v = tan(i)/i | |
if v > max: | |
max = v | |
print(f"{i}: {i} <-> {v}") | |
def chug_randoms(): | |
max = 0 | |
for i in range(1,1000000000000): | |
r = random()*pi/2 | |
v = tan(r)/i | |
if v > max: | |
max = v | |
print(f"{i}: {r} <-> {v}") | |
# Pick one: | |
chug_primes() | |
# chug_integers() | |
# chug_randoms() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment