Skip to content

Instantly share code, notes, and snippets.

View jac18281828's full-sized avatar
🦌

John Cairns jac18281828

🦌
View GitHub Profile
@deeplook
deeplook / pi_digits.py
Created February 13, 2013 20:16
Generate digits of Pi using a spigot algorithm.
"""
Run the algorithm below using CPython, Cython, PyPy and Numba and compare
their performance. (This is implementing a spigot algorithm by A. Sale,
D. Saada, S. Rabinowitz, mentioned on
http://mail.python.org/pipermail/edu-sig/2012-December/010721.html).
"""
def pi_digits(n):
"Generate n digits of Pi."
k, a, b, a1, b1 = 2, 4, 1, 12, 4
@jac18281828
jac18281828 / longest_seq_pi.py
Last active August 21, 2021 14:00
Show the Feynman Point is the longest sequence in the first 100000 digits of py
import unittest
class longest_seq:
def find(sentence):
pos = 0
l = 0
cl = 0
cpos = 0
i = 0
t = ''