View foursquare.cc
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
// p,q -> a,b,c,d with a^2+b^2+c^2+d^2==p*q | |
// | |
// f=foursquare | |
// | |
// g++ $f.cc -lgmp -lgmpxx -O3 -o $f -lpari -DPARI -Wall -Wextra -pedantic | |
// | |
// $ ./$f 999999999999999999999999999989 999999999999999999999999999983 | |
// R = qfsolve(M) | |
// 2.85703s | |
// 223605138439657340220247124809 147944036070869714718268156597 314020169936458430849348767399 910771451642793118995923538064 |
View nsum.py
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, R1728 | |
# invalid-name, consider-using-generator | |
""" blacked and pylinted; https://mersenneforum.org/showthread.php?t=22915 """ | |
import sys | |
from sys import argv, stderr | |
from math import isqrt | |
N = 15 if len(argv) < 2 else int(argv[1]) | |
a = [[] for i in range(N + 1)] | |
stop = len(argv) >= 3 |
View rsa_test.gp
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
\r RSA_numbers_factored.gp | |
test(v)= | |
{ | |
if(#v<4, | |
break()); | |
my([l,n,p,q]=v,pnr,qnr,sqrtm1); | |
if ((p%4!=1)||(q%4!=1), | |
break()); | |
forprime(t=2,oo, |
View range_client
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 | |
if [[ "$3" != '' ]] | |
then | |
for((i=1; i<=$3; ++i)) | |
do | |
$0 "$1" "$2" & | |
done | |
exit | |
fi |
View range_server.py
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) | |
""" | |
python range_server.py port start stop | |
""" | |
from socketserver import TCPServer | |
from http.server import SimpleHTTPRequestHandler | |
from threading import Thread | |
from timeit import default_timer | |
from time import strftime, gmtime | |
from sys import argv, stdout |
View cado-nfs.loop
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 | |
p="" | |
date | |
echo "=======================" | |
./cado-nfs.py $1 | |
while [ $? -ne 0 ] | |
do | |
date | |
echo "=======================" |
View wol.js
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
// eslinted; send wakeonlan magic packet for mac address defined in m | |
// | |
const m = Buffer.from([0x9c, 0x6b, 0x00, 0x15, 0xbd, 0xc2]); | |
const p = Buffer.concat([Buffer.alloc(6,0xff),m,m,m,m,m,m,m,m,m,m,m,m,m,m,m,m]); | |
const sock = require('dgram').createSocket('udp4').on('listening', function() { | |
sock.setBroadcast(true); | |
sock.send(p, 0, p.length, 9, '255.255.255.255', function() { | |
sock.close(); | |
}); |
View latest_new_primes
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 | |
wget -O /tmp/all.txt https://t5k.org/primes/lists/all.txt 2> /dev/null | |
if [ ! -f t5k.org_primes_lists_all.txt ] | |
then | |
echo "initial download of largest primes list" | |
cp /tmp/all.txt t5k.org_primes_lists_all.txt | |
fi | |
if [ ! -f t5k.org_primes_lists_all.txt.old ] |
View sqrtm1.smallest_known_1million_digit_prime.cc
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 |
View cypari2_.py
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 |
NewerOlder