Skip to main content
33 votes

Pointlessly make your way down the alphabet

Dyalog APL Extended, 4 bytes ⌽∘⍳¨ Try it online! ...
dzaima's user avatar
  • 20.3k
28 votes

1, 2, 4, 8, 16, ... 33?

Python, 51 bytes f=lambda n,k=2:n<3or k<n and f(k)*f(n-k-2)+f(n,k+1) Try it online! Simplifies the formula a bit: $$a(n) = \sum_{k=2}^{n-1} a(k)\cdot a(n-...
xnor's user avatar
  • 150k
27 votes

Tiny Lisp, tiny interpreter

Acc!!, 9450 9334 8897 6737 bytes ...
emanresu A's user avatar
  • 46.2k
20 votes

Nesting list with a value repeated `n` amount of times

Python 2, 33 30 bytes -3 bytes thanks to @xnor lambda n,v:eval('[v,'*n+']'*n) Try it online!
dingledooper's user avatar
  • 23.4k
19 votes

One More Program and I'm Out!

Jelly, 2 bytes Ṿ¡ Try it online! ...
hyperneutrino's user avatar
  • 42.8k
19 votes

One More Program and I'm Out!

JavaScript (ES6), 47 44 bytes Saved 3 bytes thanks to @HermanLauenstein Takes input in currying syntax (n)(s). ...
Arnauld's user avatar
  • 206k
14 votes

Pointlessly make your way down the alphabet

C (gcc),  58  56 bytes Saved 2 bytes thanks to @KritixiLithos c;f(char*s){while(c=c&&putchar(c>96?c:10)^10?c-1:*s++);} Try it online!
Arnauld's user avatar
  • 206k
14 votes

Pointlessly make your way down the alphabet

Haskell, 26 24 bytes -2 bytes thanks to FrownyFrog. map(\i->reverse['a'..i]) Try it online! Pointless (or pointfree :P) for you.
totallyhuman's user avatar
  • 17.4k
14 votes

Pointlessly make your way down the alphabet

Malbolge20 and Malbolge Unshackled polyglot, around 2MB, 107KB compressed. Alright. I spent around 30 minutes on this answer (current record). It's really optimal answer. Albeit not so fast and not ...
Kamila Szewczyk's user avatar
12 votes

1, 2, 4, 8, 16, ... 33?

Perl 6, 44 bytes {1,1,1,1,{sum @_[2..*]Z*@_[@_-4...0,0]}...*} Try it online! Anonymous code block that returns a lazy infinite sequence of values. This pretty ...
Jo King's user avatar
  • 48.1k
11 votes

1, 2, 4, 8, 16, ... 33?

05AB1E, 14 13 11 bytes $ƒˆ¯Âø¨¨¨PO Try it online! Outputs the nth element, 0-indexed. ...
Grimmy's user avatar
  • 15.8k
10 votes

One More Program and I'm Out!

sh + coreutils, 31 bytes yes exec sed 1d \$0|sed $1q;cat Takes n as a command-line parameter and ...
Neil's user avatar
  • 184k
10 votes
Accepted

Nesting list with a value repeated `n` amount of times

05AB1E, 3 bytes F‚Ù Try it online. Explanation: ...
Kevin Cruijssen's user avatar
9 votes

What's left after repeatedly removing palindromes

Nekomata, 14 bytes ʷ{;;$ƀ=tŁ¿,}aş Attempt This Online! Extremely slow for long inputs that contain many palindromes. ...
alephalpha's user avatar
  • 51.9k
8 votes

Pointlessly make your way down the alphabet

PowerShell, 37 28 bytes -9 bytes thanks to mazzy $args|%{-join($_..'a'-le$_)} Try it online! Takes input via splatting and uses char ranges introduced in PS v6. ...
Veskah's user avatar
  • 4,130
8 votes

Nesting list with a value repeated `n` amount of times

Python, 34 bytes f=lambda x,n:n and[x,f(x,n-1)][:n] Attempt This Online! Thanks to loopy walt for this one. Old answers: Python, 36 bytes f=lambda x,n:[x][n>1:]or[x,f(x,n-1)] Attempt This Online! ...
pxeger's user avatar
  • 25.3k
8 votes

Nesting list with a value repeated `n` amount of times

Vyxal r, 4 bytes (⁰"U Try it Online! The joys of golfing language :) Explained ...
lyxal's user avatar
  • 35.6k
7 votes

Tiny Lisp, tiny interpreter

tinylisp, 6161 1401 1060 931 bytes ...
Andrew Bayly's user avatar
  • 1,539
7 votes

Different combinations possible

Python, 40 bytes f=lambda n,k:k<2or~-n*n*f(n-1,k-1)/~-k/k Try it online! Uses the recurrence \$a_{n,1} = 1\$, \$a_{n,k} = \frac{n(n-1)}{k(k-1)}a_{n-1,k-1}\$.
Anders Kaseorg's user avatar
7 votes

1, 2, 4, 8, 16, ... 33?

JavaScript (ES6), 42 bytes A port of xnor's solution. 0-indexed. f=(n,k=2)=>n<3||k<n&&f(k)*f(n+~++k)+f(n,k) Try it online! JavaScript (ES6),  83 ...
Arnauld's user avatar
  • 206k
7 votes

1, 2, 4, 8, 16, ... 33?

Haskell, 49 43 39 bytes a n=max(sum[a k*a(n-2-k)|k<-[2..n-1]])1 Try it online! For n<3 the ...
nimi's user avatar
  • 36k
7 votes

1, 2, 4, 8, 16, ... 33?

Wolfram Language (Mathematica), 36 33 bytes Sum[#0[#-i]#0@--i,{i,4,#}]~Max~1& Try it online! 1-indexed. The 2-indexed sequence is 2 bytes shorter: ...
att's user avatar
  • 22.8k
7 votes

1, 2, 4, 8, 16, ... 33?

05AB1E, 17 16 13 bytes 4Å1λ£λ¨Â¦¦s¦¦*O+ Not shorter than the existing 05AB1E answer, but I wanted to try the recursive functionality of the new 05AB1E version as ...
Kevin Cruijssen's user avatar
7 votes

Pointlessly make your way down the alphabet

Python 3, 65 bytes lambda s:print([''.join(map(chr,range(ord(c),96,-1)))for c in s]) Outputs a list of strings as clarified in @Arnauld's comment. If we could ...
Brojowski's user avatar
  • 161
7 votes

Pointlessly make your way down the alphabet

Sed (with -r switch), 65 61 60 59 characters s/./&zyxwvutsrqponmlkjihgfedcba \n/g s/(.).*\1/\1/gm s/ //g Thanks to: ...
manatwork's user avatar
  • 20.9k
7 votes

Visualize a Recursive Acronym

APL (Dyalog Extended), 33 32 bytes -1 byte thanks to Bubbler. Anonymous infix lambda. Takes count as left argument and string as right argument. ...
Adám's user avatar
  • 31.8k
7 votes

Visualize a Recursive Acronym

JavaScript (ES9),  88 85  82 bytes Takes input as (string)(n). ...
Arnauld's user avatar
  • 206k
7 votes

Unicode T-square

JavaScript (ES6), 108 bytes Returns an array of strings, with 0123 instead of ┌┐└┘. ...
Arnauld's user avatar
  • 206k
7 votes

Nesting list with a value repeated `n` amount of times

Proton, 25 bytes n=>v=>((a=>[v,a])*n)([v]) Try it online! ...
hyperneutrino's user avatar
  • 42.8k
7 votes

Number of cigarettes that can be made from a given number of butts

JavaScript (ES6), 10 bytes Unless I'm missing something, this boils down to: n=>~-n/3|0 Try it online! Or 9 bytes with BigInts.
Arnauld's user avatar
  • 206k

Only top scored, non community-wiki answers of a minimum length are eligible