Skip to main content
edited body
Source Link
Sp3000
  • 61.9k
  • 13
  • 115
  • 287

FRACTRAN, 144 bytes

29/14 222/377 59/26 247/59 329/57 19/47 2/19 11/29 403/407 217/33 11/31 2/11 1/37 1/2 23/9 43/69 23/43 1/23 425/41 4823/85 17/53 41/25 2/119 1/5

This took me way longer than expected - special casing 1 was pretty annoying. Takes 5^n as input and outputs 3^0 = 1 (falsy) if composite, or 3^1 = 73 (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.

FRACTRAN, 144 bytes

29/14 222/377 59/26 247/59 329/57 19/47 2/19 11/29 403/407 217/33 11/31 2/11 1/37 1/2 23/9 43/69 23/43 1/23 425/41 4823/85 17/53 41/25 2/119 1/5

This took me way longer than expected - special casing 1 was pretty annoying. Takes 5^n as input and outputs 3^0 = 1 (falsy) if composite, or 3^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.

FRACTRAN, 144 bytes

29/14 222/377 59/26 247/59 329/57 19/47 2/19 11/29 403/407 217/33 11/31 2/11 1/37 1/2 23/9 43/69 23/43 1/23 425/41 4823/85 17/53 41/25 2/119 1/5

This took me way longer than expected - special casing 1 was pretty annoying. Takes 5^n as input and outputs 3^0 = 1 (falsy) if composite, or 3^1 = 3 (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.

deleted 7 characters in body
Source Link
Sp3000
  • 61.9k
  • 13
  • 115
  • 287

FRACTRAN, 150144 bytes

229/1514 385222/26377 1759/6526 247/1759 69329/13357 19/2347 52/19 2911/229 403/319407 93217/20333 2911/31 52/2911 1/1137 1/52 3723/499 4143/25969 3723/4143 1/3723 94987425/5341 23014823/202185 4317/59 53 41/220925 52/129119 1/475

This took me way longer than expected - special casing 1 was pretty annoying. Takes 47^n5^n as input and outputs 7^03^0 = 1 (falsy) if composite, or 7^13^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.

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.

FRACTRAN, 144 bytes

29/14 222/377 59/26 247/59 329/57 19/47 2/19 11/29 403/407 217/33 11/31 2/11 1/37 1/2 23/9 43/69 23/43 1/23 425/41 4823/85 17/53 41/25 2/119 1/5

This took me way longer than expected - special casing 1 was pretty annoying. Takes 5^n as input and outputs 3^0 = 1 (falsy) if composite, or 3^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.

Source Link
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.