lily — 11/3/2022, 9:08:27 PM

(n - 1)! + 1 is divisible by n if n is prime or 1

EDIT: therefore floor ( cos pi ((n-1)!+1)/n )² is a boolean prime detector :3

♥ 4 ↩ 1 💬 7 comments

comments

pkmnq:

You don’t actually need to rely on Wilson’s theorem to make a prime detector, a related and easier to prove (in fact it’s only half of the proof of Wilson’s theorem) theorem states that (n - 1)! is divisible by n if n is a composite number greater than 4.

Here’s my version of the boolean prime detector: (1-floor (cos pi ((n-1)! + 1)/n)²)(1-floor (1/(ceil|x-4|+1)))

It’s longer, but doesn’t rely on a theorem I don’t understand.

11/4/2022, 4:22:43 AM
mef:

incredible 👏👏👏

11/3/2022, 9:11:43 PM
mef:

with the edit, its now even more incredible

engineer gaming

11/3/2022, 9:15:22 PM
mef:

but seriously like, how are you so incredibly smart, that’s like you’re writing a computer script but instead with pure math

11/3/2022, 9:20:07 PM
lily:

it’s just part of willans’ formula, i just found it interesting

11/3/2022, 9:44:15 PM
mef:

never heard of it (I’m in alg 2 rn, what course are you taking?)

11/3/2022, 10:21:38 PM
oren:

Ayo I'm in the same one

11/4/2022, 12:54:25 AM