Skip to main content
58 votes

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

18 Steps ...
Etoplay's user avatar
  • 3,401
38 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
22 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.6k
18 votes

Detect round trips on a hyperbolic grid

Python, 259 bytes ...
Anders Kaseorg's user avatar
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
15 votes

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

23 steps ...
Antony's user avatar
  • 393
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
  • 77k
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.9k
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.8k
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
  • 39.1k
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 ...
UnlimitedHighground's user avatar
11 votes

Construct this point

Python, 511 bytes ...
Command Master's user avatar
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
  • 193k
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
  • 172k
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,167
9 votes

Is the group cyclic?

Husk, 11 10 9 bytes VS≡`ȯU¡!1 1-based. Returns the index of a generator if one exists, 0 otherwise. Try it online! Explanation ...
Zgarb's user avatar
  • 42.7k
9 votes

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

...
Jalil Compaoré's user avatar
9 votes

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

304 steps Community wiki because this proof is generated by Mathematica's FindEquationalProof function. The proof is rather long. Mathematica doesn't know how to golf it. This is the Mathematica ...

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