Created
April 19, 2021 18:27
-
-
Save telliott99/bcec0f359a30b3303280cfa42d2b33cc to your computer and use it in GitHub Desktop.
This file contains hidden or 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 math,sys | |
try: | |
N = int(sys.argv[1]) + 1 | |
except: | |
print('enter the last value') | |
sys.exit() | |
R = range(2,N) | |
rL = list() | |
for d in R: | |
m = int(math.pi * d) | |
n = m + 1 | |
p = m/d | |
q = n/d | |
assert p < math.pi < q | |
if math.gcd(n,d) == 1: | |
a = q - math.pi | |
rL.append((d,math.log(a,10))) | |
if math.gcd(m,d) == 1: | |
b = math.pi - p | |
rL.append((d,math.log(b,10))) | |
for x,y in rL: | |
print(str(x) + ',' + str(y)[:10]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment