Skip to main content
deleted 2 characters in body
Source Link
Jonah
  • 34.1k
  • 4
  • 41
  • 95

J, 5352 bytes

load 'plot' f=.:[:plot[:;/@|(}:2]\;}.)(2&|{-:,1+*&3)^:(>&1)^:a: 

Try it online!Try it online!

Wasn't sure if loading the graphics lib counted towards byte count, so I included it.

Here's an image of calling f 27 in the J console:

27

J, 53 bytes

load 'plot' f=.[:plot[:;/@|:2]\(2&|{-:,1+*&3)^:(>&1)^:a: 

Try it online!

Wasn't sure if loading the graphics lib counted towards byte, so I included it.

Here's an image of calling f 27 in the J console:

27

J, 52 bytes

load 'plot' f=:[:plot[:(}:;}.)(2&|{-:,1+*&3)^:(>&1)^:a: 

Try it online!

Wasn't sure if loading the graphics lib counted towards byte count, so I included it.

Here's an image of calling f 27 in the J console:

27

Source Link
Jonah
  • 34.1k
  • 4
  • 41
  • 95

J, 53 bytes

load 'plot' f=.[:plot[:;/@|:2]\(2&|{-:,1+*&3)^:(>&1)^:a: 

Try it online!

Wasn't sure if loading the graphics lib counted towards byte, so I included it.

Here's an image of calling f 27 in the J console:

27