stateDiagram
[*] --> Still
Still --> [*]
Still --> Moving
Moving --> Still
Moving --> Crash
Crash --> [*]
This file has been truncated, but you can view the full file.
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
// x,y -> sqrtm1 [-> x,y] | |
// | |
// https://t5k.org/primes/lists/all.txt | |
// 2147 10^999999+308267*10^292000+1 1000000 CH10 2021 | |
// | |
// f=sqrtm1.smallest_known_1million_digit_prime | |
// | |
// either | |
// g++ $f.cc -lgmp -lgmpxx -O3 -o $f | |
// or |
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 gcd, I | |
try: | |
import cypari2 | |
pari = cypari2.Pari() | |
gen_to_python = cypari2.convert.gen_to_python | |
except ImportError: | |
cypari2 = None |
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
# pylint:disable=C0103, C0114, C0116, W0611 | |
from math import sqrt, floor, pi, e | |
from sympy import nextprime, isprime | |
def digits(n): | |
return len(str(n)) | |
phi = (sqrt(5) + 1) / 2 |
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
\\ sq2(p) determines sum of squares for prime p = 1 (mod 4), implement "assert()" | |
\\ | |
\\ based on | |
\\ - https://pari.math.u-bordeaux.fr/Events/PARI2019b/talks/init.pdf | |
\\ - https://pari.math.u-bordeaux.fr/Events/PARI2019b/talks/prog.pdf | |
\\ - https://pari.math.u-bordeaux.fr/pub/pari/manuals/2.15.1/tutorial.pdf | |
\\ - https://skalatan.de/en/archive/pariguide/doc/Programming_under_GP.html | |
\\ - https://home.gwu.edu/~maxal/gpscripts/binomod.gp | |
\\ | |
assert(b, v, s) = { if(!(b), error(Str(v) Str(s))); } |
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
#!/bin/bash | |
pip install setuptools Cython gmpy2 | |
rm -rf /tmp/tst && mkdir /tmp/tst && cd /tmp/tst | |
wget -q https://gist.githubusercontent.com/Hermann-SW/061d33b47325bd15a4033b33d3f7c4c9/raw/9900616d98b6acdd50c436d9ae914a1c5d81f2b2/sq2_cg.py | |
mv sq2_cg.py sq2_cg.pyx | |
cat << EOF > setup.py | |
from setuptools import setup |
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
""" | |
sq2_sympy.py from here (plus time print() in "sq2()"): | |
https://github.com/sympy/sympy/issues/15358#issuecomment-1551635777 | |
2.5GHz i7-11850H | |
1998.6601960659027s a = sqrt(-1) (mod p) | |
2011.4160270690918s x, y = gcd(p, a + I).as_real_imag() | |
""" | |
from math import log10 |
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
# pylint: disable=C0103 | |
# invalid-name | |
""" | |
determine sum of squares for 2467-digit prime | |
- minimized for pycg analysis | |
- original: https://github.com/Hermann-SW/RSA_numbers_factored/blob/main/python/sq2.py | |
- manually converted to Graphviz with splines=ortho | |
- shortened GraphvizFiddle Share link: https://stamm-wilbrandt.de/sq2_cg.py.gvf.html | |
""" | |
from time import time |
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
const DecimalJs = require('decimal.js'); | |
const Big = require('big.js'); | |
const BigInteger = require('big-integer'); | |
// const { init: initGMP, DivMode } = require('../dist/index.umd.js'); | |
const { init: initGMP, DivMode } = require('gmp-wasm'); | |
const piDecimals = require("pi-decimals"); | |
const mpzjs = require("mpzjs"); | |
function nullish(lhs, rhs) { | |
return (lhs === null || lhs === undefined) ? rhs : lhs |
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
begin | |
comment v0.1, only factors sometimes as of now | |
comment runs with this compiler: https://github.com/JvanKatwijk/algol-60-compiler | |
$ jff-algol Lehman_factor.alg | |
$ ./Lehman_factor | |
32639 3 | |
127 | |
$ | |
; |