Skip to main content
Scraped a couple bytes off.
Source Link

Ruby, 9797 95 bytes

->n{c=!r=[1,1] (2...n).map{|i|c|=1>n%i r=[0[n]&r=[0,*r,0].each_cons(2).map{|a,b|a+b}}.flatten&[n]==[]&&c&[[n]]==[]&&c} 

Try it online!Try it online!

I'm sure it can be made smallerScraped a couple bytes off.

Ruby, 97 bytes

->n{c=!r=[1,1] (2...n).map{|i|c|=1>n%i r=[0,*r,0].each_cons(2).map{|a,b|a+b}}.flatten&[n]==[]&&c} 

Try it online!

I'm sure it can be made smaller.

Ruby, 97 95 bytes

->n{c=!r=[1,1] (2...n).map{|i|c|=1>n%i [n]&r=[0,*r,0].each_cons(2).map{|a,b|a+b}}&[[n]]==[]&&c} 

Try it online!

Scraped a couple bytes off.

Source Link

Ruby, 97 bytes

->n{c=!r=[1,1] (2...n).map{|i|c|=1>n%i r=[0,*r,0].each_cons(2).map{|a,b|a+b}}.flatten&[n]==[]&&c} 

Try it online!

I'm sure it can be made smaller.