Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

Commonmark migration
Source Link

#Jelly , (削除) 11 (削除ここまで) 10 bytes

Jelly , (削除) 11 (削除ここまで) 10 bytes

RUḶ’F2*ĊÄŻ

Port of @Grimy's 05AB1E answer, so make sure to upvote him!
-1 byte thanks to @Grimy.

Try it online.

Explanation:

R # Create a list in the range [1, (implicit) argument]
 U # Reverse it to [argument, 1]
 Ḷ # Create an inner list in the range [0, N) for each value N in this list
 ’ # Decrease each by 1
 F # Flatten the list of lists
 2* # Take 2 to the power each
 Ċ # Ceil
 Ä # Undelta (cumulative sum) the list
 Ż # And add a leading 0
 # (after which the result is output implicitly)

#Jelly , (削除) 11 (削除ここまで) 10 bytes

RUḶ’F2*ĊÄŻ

Port of @Grimy's 05AB1E answer, so make sure to upvote him!
-1 byte thanks to @Grimy.

Try it online.

Explanation:

R # Create a list in the range [1, (implicit) argument]
 U # Reverse it to [argument, 1]
 Ḷ # Create an inner list in the range [0, N) for each value N in this list
 ’ # Decrease each by 1
 F # Flatten the list of lists
 2* # Take 2 to the power each
 Ċ # Ceil
 Ä # Undelta (cumulative sum) the list
 Ż # And add a leading 0
 # (after which the result is output implicitly)

Jelly , (削除) 11 (削除ここまで) 10 bytes

RUḶ’F2*ĊÄŻ

Port of @Grimy's 05AB1E answer, so make sure to upvote him!
-1 byte thanks to @Grimy.

Try it online.

Explanation:

R # Create a list in the range [1, (implicit) argument]
 U # Reverse it to [argument, 1]
 Ḷ # Create an inner list in the range [0, N) for each value N in this list
 ’ # Decrease each by 1
 F # Flatten the list of lists
 2* # Take 2 to the power each
 Ċ # Ceil
 Ä # Undelta (cumulative sum) the list
 Ż # And add a leading 0
 # (after which the result is output implicitly)
deleted 7 characters in body
Source Link
Kevin Cruijssen
  • 136.2k
  • 14
  • 154
  • 394

#Jelly, 11(削除) 11 (削除ここまで) 10 bytes

RUR_2F2*ĊÄŻRUḶ’F2*ĊÄŻ

Port of @Grimy's 05AB1E answer, so make sure to upvote him!
I'm not too skilled with Jelly, so might still be golfable a bit-1 byte thanks to @Grimy.

Try it online. Try it online.

Explanation:

R # Create a list in the range [1, (implicit) argument]
 U # Reverse it to [argument, 1]
 R  # Create an inner list [1in the range [0, N]N) for each value N in this list
 _2 # SubtractDecrease 2each fromby each1
 F # Flatten the list of lists
 2* # Take 2 to the power each
 Ċ # Ceil
 Ä # Undelta (cumulative sum) the list
 Ż # And add a leading 0
 # (after which the result is output implicitly)

#Jelly, 11 bytes

RUR_2F2*ĊÄŻ

Port of @Grimy's 05AB1E answer, so make sure to upvote him!
I'm not too skilled with Jelly, so might still be golfable a bit.

Try it online.

Explanation:

R # Create a list in the range [1, (implicit) argument]
 U # Reverse it to [argument, 1]
 R # Create an inner list [1, N] for each value N in this list
 _2 # Subtract 2 from each
 F # Flatten the list of lists
 2* # Take 2 to the power each
 Ċ # Ceil
 Ä # Undelta the list
 Ż # And add a leading 0
 # (after which the result is output implicitly)

#Jelly, (削除) 11 (削除ここまで) 10 bytes

RUḶ’F2*ĊÄŻ

Port of @Grimy's 05AB1E answer, so make sure to upvote him!
-1 byte thanks to @Grimy.

Try it online.

Explanation:

R # Create a list in the range [1, (implicit) argument]
 U # Reverse it to [argument, 1]
  # Create an inner list in the range [0, N) for each value N in this list
  # Decrease each by 1
 F # Flatten the list of lists
 2* # Take 2 to the power each
 Ċ # Ceil
 Ä # Undelta (cumulative sum) the list
 Ż # And add a leading 0
 # (after which the result is output implicitly)
Source Link
Kevin Cruijssen
  • 136.2k
  • 14
  • 154
  • 394

#Jelly, 11 bytes

RUR_2F2*ĊÄŻ

Port of @Grimy's 05AB1E answer, so make sure to upvote him!
I'm not too skilled with Jelly, so might still be golfable a bit.

Try it online.

Explanation:

R # Create a list in the range [1, (implicit) argument]
 U # Reverse it to [argument, 1]
 R # Create an inner list [1, N] for each value N in this list
 _2 # Subtract 2 from each
 F # Flatten the list of lists
 2* # Take 2 to the power each
 Ċ # Ceil
 Ä # Undelta the list
 Ż # And add a leading 0
 # (after which the result is output implicitly)

AltStyle によって変換されたページ (->オリジナル) /