Skip to main content
1 of 3
Sp3000
  • 61.9k
  • 13
  • 115
  • 287

FRACTRAN, 150 bytes

2/15 385/26 17/65 247/17 69/133 19/23 5/19 29/2 403/319 93/203 29/31 5/29 1/11 1/5 37/49 41/259 37/41 1/37 94987/53 2301/2021 43/59 53/2209 5/129 1/47

This took me way longer than expected - special casing 1 was pretty annoying. Takes 47^n as input and outputs 7^0 = 1 (falsy) if composite, or 7^1 = 7 (truthy) if prime.

The approach is similar to Conway's prime generator, performing a divmod on descending divisors. This isn't as compact though, so there's still much to golf.

Sp3000
  • 61.9k
  • 13
  • 115
  • 287