58 votes

(-a) × (-a) = a × a

18 Steps ...
Etoplay's user avatar
  • 3,401
37 votes

(-a) × (-a) = a × a

18 steps Different from the already posted 18-step solution. ...
Emil Jeřábek's user avatar
29 votes

(-a) × (-a) = a × a

29 26 Steps No lemmas! Comment if you see anything wrong. (It's very easy to make a mistake) ...
H.PWiz's user avatar
  • 11.6k
22 votes

How does the square end?

Google Sheets, 52 51 47 bytes =ArrayFormula(Join(",",Unique(Mod(Row(A:A)^2,A1 Saved 4 bytes thanks to Taylor Scott Sheets will automatically add 4 ...
Engineer Toast's user avatar
21 votes

(-a) × (-a) = a × a

18 steps Not the first 18-step proof, but it’s simpler than the others. ...
Anders Kaseorg's user avatar
21 votes
Accepted

Demonstrate some advanced abstract algebra

Proof of impossibility The only anti-distributive operator when \$S=\mathbb Z\$ is such that \$\forall a, \forall b, a*b=0\$. Indeed, suppose that \$*\$ is anti-distributive. Then \$*\$ has the ...
Robin Ryder's user avatar
  • 15.5k
18 votes

Detect round trips on a hyperbolic grid

Python, 259 bytes ...
Anders Kaseorg's user avatar
16 votes
Accepted

Cycling with Rubik's

Pyth, 66 63 bytes l.uum.rW}Hdd@_sm_B.iFP.>c3Zk3xZHG_r_Xz\'\39Nf!s}RTcZ2y=Z"UDLRFB Try it online: Demonstration or Test Suite. Notice that the program is kinda ...
Jakube's user avatar
  • 21.9k
16 votes
Accepted

Compute the inverse of an integer modulo 100000000003

Pyth, 24 bytes L-b*/bJ+3^T11Jy*uy^GT11Q Test suite This uses the fact that a^(p-2) mod p = a^-1 mod p. First, I manually reimplement modulus, for the specific ...
isaacg's user avatar
  • 42k
16 votes

Fundamental Solution of the Pell Equation

Piet, 612 codels Takes n from standard input. Outputs y then x, space-separated. Codel size 1: Codel size 4, for easier viewing: Explanation Check out this NPiet trace, which shows the program ...
Tim Pederick's user avatar
  • 1,721
14 votes

(-a) × (-a) = a × a

23 steps ...
Antony's user avatar
  • 383
14 votes

Multiply elements of the dihedral group

J, 23 bytes ~:/I.@,~4|[:-/1#;._1@,] Try it online! Takes a boolean vector where 0 represents ...
Bubbler's user avatar
  • 73.8k
13 votes

Cycling with Rubik's

GAP, 792 783 782 749 650 Bytes This seems to be working. If it messes up with something let me know. Thanks to @Lynn for suggesting that I decompose some of the primitive moves. Thanks to @Neil for ...
Liam's user avatar
  • 3,205
13 votes

∀ a b. a + b = b + a

Lean, 451 449 445 439 414 407 bytes ...
Mario Carneiro's user avatar
12 votes

Define a field with 256 elements

Python 2, 11 + 45 = 56 bytes Addition (11 bytes): int.__xor__ Multiplication (45 bytes): ...
Sp3000's user avatar
  • 61.7k
12 votes

∀ a b. a + b = b + a

Lean, 268 bytes ...
Anders Kaseorg's user avatar
11 votes

Algebraic curve plotter

Haskell, 283 275 bytes The function g should be called with the matrix and the two ranges as arguments. The matrix is just a list of lists, the ranges each a two ...
flawr's user avatar
  • 43.7k
11 votes

No strings attached!

Retina, 21 bytes +`(.)(?!\1)(?i)\1 ^$ Try it online! Like flawr's solution, this just repeatedly deletes adjacent uppercase/lowercase pairs and then checks ...
Martin Ender's user avatar
11 votes

Square root a number

Python 2, 166 bytes ...
orlp's user avatar
  • 39k
11 votes

Are these braids equal?

Haskell, 190 bytes ...
Anders Kaseorg's user avatar
11 votes

Modular multiplicative inverse

Mathematica, 14 bytes Obligatory Mathematica builtin: ModularInverse It's a function that takes two arguments (a and ...
Tutleman's user avatar
  • 581
10 votes
Accepted

Irreducible polynomials over GF(5)

Jelly, 30 23 22 20 bytes ÆF>1’PḄ ÆDµU5*×Ç€S:Ṫ Try it online! or verify all test cases at once. Algorithm This uses the formula $$\text{A001692}(n) = \frac 1 n \...
Dennis's user avatar
  • 210k
10 votes

Cycling with Rubik's

Mathematica, 413 401 bytes ...
njpipeorgan's user avatar
  • 3,102
10 votes

Fundamental Solution of the Pell Equation

Piet, 184 codels This is the brute-force alternative I said (in my other answer) that I didn't want to write. It takes over 2 minutes to compute the solution for n = 13. I really don't want to try it ...
Tim Pederick's user avatar
  • 1,721
10 votes

Dihedral group D4 composition with custom labels

Ruby, 18 bytes ->a,b{a+b*~0**a&7} Ungolfed ...
Level River St's user avatar
10 votes

AoCG2021 Day 22: Hyperbolic rescue

Perl 5 -p, 82 bytes s/./"bc"x($&+3)."ab"/ge;1while s/(.)\1//+s/(b|cac)a/a$1/+s/(cbcbca?)b/b$1/;$_=y;a; ...
Anders Kaseorg's user avatar
10 votes

Normal Subgroups of \$S_4\$

JavaScript (ES6), 23 bytes Expects a permutation of the string "4567" and returns 0 ... ...
Arnauld's user avatar
  • 189k
10 votes

Detect round trips on a hyperbolic grid

Retina 0.8.2, 55 bytes \d $*RF FRRRFRRRF RFRFR FRFRF RRRFRRRFRRR }`FF|RRRR ^$ Try it online! Takes input as 123 but test suite ...
Neil's user avatar
  • 166k
9 votes

Compute the inverse of an integer modulo 100000000003

Haskell, 118 113 105 101 bytes Inspired from this solution. -12 from Ørjan Johansen ...
bartavelle's user avatar
  • 1,311
9 votes
Accepted

How does the square end?

Jelly, 5 bytes R²%³Q Try it online! Explanation ...
Business Cat's user avatar
  • 9,157

Only top scored, non community-wiki answers of a minimum length are eligible