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: digits = 3 | |
....: | |
....: for a in range(10^(digits-1), 10^digits - 10^(digits - 1) + 2): | |
....: x = (10^digits + 1)*a - a^2 | |
....: for b in divisors(x): | |
....: if 10^(digits - 1) <= b < 10^digits and 10^(digits - 1) <= x//b < 10^digits: | |
....: print(a, b, "|", x//b, 10^digits + 1 - a) | |
....: | |
100 100 | 901 901 | |
100 106 | 850 901 |
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: for a in range(10, 92): | |
....: x = 101*a - a^2 | |
....: for b in divisors(x): | |
....: if 10 <= b < 100 and 10 <= x//b < 100: | |
....: print(a, b, "|", x//b, 101 - a) | |
....: | |
10 10 | 91 91 | |
10 13 | 70 91 | |
10 14 | 65 91 | |
10 26 | 35 91 |
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 math | |
TABLE = { | |
(0, +1): (+1, True), # () | |
(1, +1): (-1, False), # (0 1 2) | |
(2, +1): (-1, True), # (0 2 1) | |
(0, -1): (+1, False), # (0 1) | |
(1, -1): (-1, True), # (1 2) | |
(2, -1): (+1, True) # (0 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
445 | |
ABACA5 | |
A64CA5 | |
A84C45 | |
4BACA5 | |
ABAC1 | |
484C1 | |
46AC5 | |
ABAF7 | |
48AF7 |
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
^(1|8|[29]3*[29]|(3|[29]3*4)(1|8|[07]3*4)*(6|[07]3*[29])|(4|[29]3*5|(3|[29]3*4)(1|8|[07]3*4)*(2|9|[07]3*5))(6|43*5|(5|43*4)(1|8|[07]3*4)*(2|9|[07]3*5))*(3|43*[29]|(5|43*4)(1|8|[07]3*4)*(6|[07]3*[29]))|(5|[29]3*6|(3|[29]3*4)(1|8|[07]3*4)*(3|[07]3*6)|(4|[29]3*5|(3|[29]3*4)(1|8|[07]3*4)*(2|9|[07]3*5))(6|43*5|(5|43*4)(1|8|[07]3*4)*(2|9|[07]3*5))*(0|7|43*6|(5|43*4)(1|8|[07]3*4)*(3|[07]3*6)))(4|[18]3*6|(2|9|[18]3*4)(1|8|[07]3*4)*(3|[07]3*6)|(3|[18]3*5|(2|9|[18]3*4)(1|8|[07]3*4)*(2|9|[07]3*5))(6|43*5|(5|43*4)(1|8|[07]3*4)*(2|9|[07]3*5))*(0|7|43*6|(5|43*4)(1|8|[07]3*4)*(3|[07]3*6)))*(0|7|[18]3*[29]|(2|9|[18]3*4)(1|8|[07]3*4)*(6|[07]3*[29])|(3|[18]3*5|(2|9|[18]3*4)(1|8|[07]3*4)*(2|9|[07]3*5))(6|43*5|(5|43*4)(1|8|[07]3*4)*(2|9|[07]3*5))*(3|43*[29]|(5|43*4)(1|8|[07]3*4)*(6|[07]3*[29])))|(6|[29]3*[07]|(3|[29]3*4)(1|8|[07]3*4)*(4|[07]3*[07])|(4|[29]3*5|(3|[29]3*4)(1|8|[07]3*4)*(2|9|[07]3*5))(6|43*5|(5|43*4)(1|8|[07]3*4)*(2|9|[07]3*5))*(1|8|43*[07]|(5|43*4)(1|8|[07]3*4)*(4|[07]3*[07]))|(5|[29]3*6|(3|[29]3*4)(1|8|[07]3*4)*( |
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
; "memories" by HellMood/DESiRE | |
; the tiny megademo, 256 byte msdos intro | |
; shown in April 2020 @ REVISION | |
; | |
; (= WILL BE COMMENTED IN DETAIL LATER =) | |
; | |
; create : nasm.exe memories.asm -fbin -o memories.com | |
; CHOOSE YOUR TARGET PLATFORM (compo version is dosbox) | |
; be sure to use the dosbox.conf from this archive! | |
; only ONE of the defines should be active! |
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
var dfa = DFA.create(); | |
var i, j; | |
for (i = 0; i <= 5; i++) for (j = 0; j <= 1; j++) { | |
dfa.addState(i + "." + j); | |
} | |
for (i = 0; i <= 5; i++) for (j = 0; j <= 1; j++) { | |
dfa.addTransition(i + "." + j, Math.min(5, i+1) + "." + Math.min(j+1, 1), C('c')); | |
dfa.addTransition(i + "." + j, Math.min(5, i+1) + "." + j, A(C('f'), C('a'), C('e'), C('t'), C('i'), C('o'))); | |
} |
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 | |
for n in range(1, 101): | |
r = re.match(r''' | |
(?=(?P<Fizz> | |
^( | |
[0369]| | |
[147][0369]*[258]| | |
([258]|[147][0369]*[147])([0369]|[258][0369]*[147])*([147]|[258][0369]*[258]) | |
)*$ |
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|7|[18]5*4|(2|9|[18]5*6)(3|[29]5*6)*(1|8|[29]5*4)|(3|[18]5*[07]|(2|9|[18]5*6)(3|[29]5*6)*(4|[29]5*[07]))(1|8|65*[07]|(0|7|65*6)(3|[29]5*6)*(4|[29]5*[07]))*(5|65*4|(0|7|65*6)(3|[29]5*6)*(1|8|[29]5*4))|(4|[18]5*[18]|(2|9|[18]5*6)(3|[29]5*6)*(5|[29]5*[18])|(3|[18]5*[07]|(2|9|[18]5*6)(3|[29]5*6)*(4|[29]5*[07]))(1|8|65*[07]|(0|7|65*6)(3|[29]5*6)*(4|[29]5*[07]))*(2|9|65*[18]|(0|7|65*6)(3|[29]5*6)*(5|[29]5*[18])))(6|35*[18]|(4|35*6)(3|[29]5*6)*(5|[29]5*[18])|(5|35*[07]|(4|35*6)(3|[29]5*6)*(4|[29]5*[07]))(1|8|65*[07]|(0|7|65*6)(3|[29]5*6)*(4|[29]5*[07]))*(2|9|65*[18]|(0|7|65*6)(3|[29]5*6)*(5|[29]5*[18])))*(2|9|35*4|(4|35*6)(3|[29]5*6)*(1|8|[29]5*4)|(5|35*[07]|(4|35*6)(3|[29]5*6)*(4|[29]5*[07]))(1|8|65*[07]|(0|7|65*6)(3|[29]5*6)*(4|[29]5*[07]))*(5|65*4|(0|7|65*6)(3|[29]5*6)*(1|8|[29]5*4)))|(5|[18]5*[29]|(2|9|[18]5*6)(3|[29]5*6)*(6|[29]5*[29])|(3|[18]5*[07]|(2|9|[18]5*6)(3|[29]5*6)*(4|[29]5*[07]))(1|8|65*[07]|(0|7|65*6)(3|[29]5*6)*(4|[29]5*[07]))*(3|65*[29]|(0|7|65*6)(3|[29]5*6)*(6|[29]5*[29]))|(4|[18]5*[18]|(2|9|[1 |
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: var("x1, x2, y") | |
....: f = exp(x1 + x2) / (1 - (1+x1)*(1+x2)*y) | |
....: | |
....: for (c, i) in f.taylor(x1, 0, 5).coefficients(): | |
....: fac1 = factorial(i) | |
....: for (d, j) in c.taylor(x2, 0, 5).coefficients(): | |
....: fac = fac1 * factorial(j) | |
....: for (e, k) in d.taylor(y, 0, 5).coefficients(): | |
....: print(i, j, k, e * fac) | |
....: |