lily @lily

(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

Nov 3, 2022, 9:08 PM
7

comments

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.

incredible 👏👏👏

with the edit, its now even more incredible

engineer gaming

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

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

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

Ayo I'm in the same one