Skip to main content
explain 2
Source Link
PkmnQ
  • 2.7k
  • 10
  • 21

cQuents, 21 bytes

_+(Tr$)%1)=Tr_+$)%1)) 

Try it online!

Port of the jelly answer.

Explanation

 r$) r_+$) # Root (defaults to square root) %1 %1 # Modulo 1 (only taking the decimal part) T ) T ) # Ceiling (round up if there is a decimal part) ( = ) # Equal (same as jelly answer) _+ # Successor (same as jelly answer) 

List output, 15 bytes

1,D2)*_-(k*2),1 

Try it online!

Playing with the output a bit, we can golf off 6 bytes.

Instead of outputting 1,2,2,2,1, it outputs 1,[2,2,2],1.

Explanation

1, # A one D2) # Digits of 2 (which is of course, just 2) *_-(k*2) # Multiplied by k*2-1 (it's multiplying a list) ,1 # Another one 

cQuents, 21 bytes

_+(Tr$)%1)=Tr_+$)%1)) 

Try it online!

Port of the jelly answer.

Explanation

 r$) r_+$) # Root (defaults to square root) %1 %1 # Modulo 1 (only taking the decimal part) T ) T ) # Ceiling (round up if there is a decimal part) ( = ) # Equal (same as jelly answer) _+ # Successor (same as jelly answer) 

List output, 15 bytes

1,D2)*_-(k*2),1 

Try it online!

Playing with the output a bit, we can golf off 6 bytes.

Instead of outputting 1,2,2,2,1, it outputs 1,[2,2,2],1.

cQuents, 21 bytes

_+(Tr$)%1)=Tr_+$)%1)) 

Try it online!

Port of the jelly answer.

Explanation

 r$) r_+$) # Root (defaults to square root) %1 %1 # Modulo 1 (only taking the decimal part) T ) T ) # Ceiling (round up if there is a decimal part) ( = ) # Equal (same as jelly answer) _+ # Successor (same as jelly answer) 

List output, 15 bytes

1,D2)*_-(k*2),1 

Try it online!

Playing with the output a bit, we can golf off 6 bytes.

Instead of outputting 1,2,2,2,1, it outputs 1,[2,2,2],1.

Explanation

1, # A one D2) # Digits of 2 (which is of course, just 2) *_-(k*2) # Multiplied by k*2-1 (it's multiplying a list) ,1 # Another one 
explain
Source Link
PkmnQ
  • 2.7k
  • 10
  • 21

cQuents, 21 bytes

_+(Tr$)%1)=Tr_+$)%1)) 

Try it online!

Port of the jelly answer.

Explanation

 r$) r_+$) # Root (defaults to square root) %1 %1 # Modulo 1 (only taking the decimal part) T ) T ) # Ceiling (round up if there is a decimal part) ( = ) # Equal (same as jelly answer) _+ # Successor (same as jelly answer) 

List output, 15 bytes

1,D2)*_+*_-(k*2),1 

Try it online!Try it online!

This is probably technically cheatingPlaying with the output a bit, we can golf off 6 bytes.

Instead of outputting 1,2,2,2,1, it outputs 1,[2,2,2],1.

cQuents, 15 bytes

1,D2)*_+(k*2),1 

Try it online!

This is probably technically cheating.

Instead of outputting 1,2,2,2,1, it outputs 1,[2,2,2],1.

cQuents, 21 bytes

_+(Tr$)%1)=Tr_+$)%1)) 

Try it online!

Port of the jelly answer.

Explanation

 r$) r_+$) # Root (defaults to square root) %1 %1 # Modulo 1 (only taking the decimal part) T ) T ) # Ceiling (round up if there is a decimal part) ( = ) # Equal (same as jelly answer) _+ # Successor (same as jelly answer) 

List output, 15 bytes

1,D2)*_-(k*2),1 

Try it online!

Playing with the output a bit, we can golf off 6 bytes.

Instead of outputting 1,2,2,2,1, it outputs 1,[2,2,2],1.

Source Link
PkmnQ
  • 2.7k
  • 10
  • 21

cQuents, 15 bytes

1,D2)*_+(k*2),1 

Try it online!

This is probably technically cheating.

Instead of outputting 1,2,2,2,1, it outputs 1,[2,2,2],1.