Skip to content

Instantly share code, notes, and snippets.

@telliott99
Created April 19, 2021 18:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save telliott99/bcec0f359a30b3303280cfa42d2b33cc to your computer and use it in GitHub Desktop.
Save telliott99/bcec0f359a30b3303280cfa42d2b33cc to your computer and use it in GitHub Desktop.
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