A flow that preserves a parabola
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
#!/usr/bin/env python3 | |
TARGET = "cnut" | |
AVOID = { "cnut", "\x63\x75\x6E\x74" } | |
WIDTH = 20 | |
HEIGHT = 10 | |
DIRS = [ (0,1), (1,1), (1,0), (1,-1), (0,-1), (-1,-1), (-1,0), (-1, 1) ] | |
import random |
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
/* efmc.c - Even Faster Maze Counter | |
(which actually turns out to be slower, lol) | |
*/ | |
#include <stdbool.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <gmp.h> | |
#include "fmc.h" |
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
import re | |
from rtree import index | |
p = index.Property() | |
p.dimension = 3 | |
ix = index.Index(properties=p) | |
def volume(cuboids): | |
return sum(( |
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.<x,y> = ZZ[] | |
R = P.quo((x^10 - 1, y^22 - y^21)) | |
| |
die = x + x^2 + x^3 | |
f = P.hom([x*y, y]) | |
| |
def reduce(f): | |
return R.cover()(f).lift() | |
| |
def next_move(p): |
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
import Control.Monad.State | |
( MonadState(put, get), runState, State ) | |
import System.IO (isEOF) | |
import Text.Parsec ( char, digit, (<|>), parse ) | |
data Snailfish = Leaf Int | Branch Snailfish Snailfish | |
deriving (Eq) | |
instance Show Snailfish where | |
show (Leaf n) = show n |
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
^(0|13*2|(2|13*4)(6|53*4)*(4|53*2)|(3|13*5|(2|13*4)(6|53*4)*(7|53*5))(73*5|(8|73*4)(6|53*4)*(7|53*5))*(6|73*2|(8|73*4)(6|53*4)*(4|53*2))|(4|13*6|(2|13*4)(6|53*4)*(8|53*6)|(3|13*5|(2|13*4)(6|53*4)*(7|53*5))(73*5|(8|73*4)(6|53*4)*(7|53*5))*(73*6|(8|73*4)(6|53*4)*(8|53*6)))(1|0(73*5|(8|73*4)(6|53*4)*(7|53*5))*(73*6|(8|73*4)(6|53*4)*(8|53*6)))*(8|0(73*5|(8|73*4)(6|53*4)*(7|53*5))*(6|73*2|(8|73*4)(6|53*4)*(4|53*2)))|(5|13*7|(2|13*4)(6|53*4)*53*7|(3|13*5|(2|13*4)(6|53*4)*(7|53*5))(73*5|(8|73*4)(6|53*4)*(7|53*5))*(0|73*7|(8|73*4)(6|53*4)*53*7)|(4|13*6|(2|13*4)(6|53*4)*(8|53*6)|(3|13*5|(2|13*4)(6|53*4)*(7|53*5))(73*5|(8|73*4)(6|53*4)*(7|53*5))*(73*6|(8|73*4)(6|53*4)*(8|53*6)))(1|0(73*5|(8|73*4)(6|53*4)*(7|53*5))*(73*6|(8|73*4)(6|53*4)*(8|53*6)))*(2|0(73*5|(8|73*4)(6|53*4)*(7|53*5))*(0|73*7|(8|73*4)(6|53*4)*53*7)))(4|03*7|(1|03*4)(6|53*4)*53*7|(2|03*5|(1|03*4)(6|53*4)*(7|53*5))(73*5|(8|73*4)(6|53*4)*(7|53*5))*(0|73*7|(8|73*4)(6|53*4)*53*7)|(3|03*6|(1|03*4)(6|53*4)*(8|53*6)|(2|03*5|(1|03*4)(6|53*4)*(7|53*5))(73*5|(8|73 |
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
^(0|9|[1a]8*7|(2|[1a]8*[09])(7|68*[09])*(5|68*7)|(3|[1a]8*[1a]|(2|[1a]8*[09])(7|68*[09])*(8|68*[1a]))(6|48*[1a]|(5|48*[09])(7|68*[09])*(8|68*[1a]))*(3|48*7|(5|48*[09])(7|68*[09])*(5|68*7))|(4|[1a]8*2|(2|[1a]8*[09])(7|68*[09])*(0|9|68*2)|(3|[1a]8*[1a]|(2|[1a]8*[09])(7|68*[09])*(8|68*[1a]))(6|48*[1a]|(5|48*[09])(7|68*[09])*(8|68*[1a]))*(7|48*2|(5|48*[09])(7|68*[09])*(0|9|68*2)))(5|28*2|(3|28*[09])(7|68*[09])*(0|9|68*2)|(4|28*[1a]|(3|28*[09])(7|68*[09])*(8|68*[1a]))(6|48*[1a]|(5|48*[09])(7|68*[09])*(8|68*[1a]))*(7|48*2|(5|48*[09])(7|68*[09])*(0|9|68*2)))*(1|a|28*7|(3|28*[09])(7|68*[09])*(5|68*7)|(4|28*[1a]|(3|28*[09])(7|68*[09])*(8|68*[1a]))(6|48*[1a]|(5|48*[09])(7|68*[09])*(8|68*[1a]))*(3|48*7|(5|48*[09])(7|68*[09])*(5|68*7)))|(5|[1a]8*3|(2|[1a]8*[09])(7|68*[09])*(1|a|68*3)|(3|[1a]8*[1a]|(2|[1a]8*[09])(7|68*[09])*(8|68*[1a]))(6|48*[1a]|(5|48*[09])(7|68*[09])*(8|68*[1a]))*(8|48*3|(5|48*[09])(7|68*[09])*(1|a|68*3))|(4|[1a]8*2|(2|[1a]8*[09])(7|68*[09])*(0|9|68*2)|(3|[1a]8*[1a]|(2|[1a]8*[09])(7|68*[09])*(8|68*[1a]) |
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
True 21430172143725346418968500981200036211228096234110672148875007767407021022498722449863967576313917162551893458351062936503742905713846280871969155149397149607869135549648461970842149210124742283755908364306092949967163882534797535118331087892154125829142392955373084335320859663305248773674411336138779 | |
True 3966212458442419910671365779256433097896266098256444502994761104680485792040114698622334941551824185891729333090617747067852863746301856735596028175773861022082860675594962411634044322686894523823171200352765854123386843446869283314184698519162260023471518534376441033216641163191116687452396104764753405716908275693926617999038170654156222260226520346000668993323085068131797019884440806222984681657959124218247652049531642454130249113786478964606565384901503505452972077736233 | |
True 45925227810970180969313328047107279360892708083547808019105709473030650455694812554266379452660250796737838585559498510937884758434522213257037254246666127415651995658124912000275511659296017948571570796025394497912646185458555 |
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
sage: %paste | |
def cgfh(cg_plus_fh): | |
for cg in range(1, cg_plus_fh): | |
fh = cg_plus_fh - cg | |
for c in divisors(cg): | |
for f in divisors(fh): | |
yield (c, cg//c, f, fh//f) | |
for r in range(1, 99, 2): | |
cg_plus_fh = (101^2 - r^2)/4 |
NewerOlder