# Tag Info

### Chicken McNugget Numbers

Python, 27 bytes lambda n:0x82492cb6dbf>>n&1 Try it online!
• 39.7k

### Chicken McNugget Numbers

Python 3, 24 bytes lambda n:0<=n--n%3*20!=3 Try it online! Explanation With 6 and 9 ...
• 49.8k

### 11 = (1+2+3+4+5) - (1+2+3) + (6) - (4)

Mathematica, 79 bytes Min[2#/(d=Divisors@#~Cases~_?OddQ)+d]-2⌊(2#)^.5+.5⌋+⌈Sqrt[8#+1]~Mod~1⌉& Explanation I couldn't be bothered to implement the algorithm ...
• 197k
Accepted

### Yo boy, must it sum

Brachylog, 7 bytes ~+ℕᵐ.↔ᵐ Try it online! Surprisingly not that slow. Explanation ...
• 38.9k

### A penny saved is a penny

Haskell, 37 34 bytes s#l@(c:d)|s>=c=(s-c)#l+s#d s#_=0^s Usage example: 26 # [1,5,10,25] -> ...
• 35.9k

### Sum of five cubes

Brachylog, 18 bytes ∧5~lLȧᵐ≥₁∧L^₃ᵐ.+?∧ Try it online! Explanation We basically describe the problem, with the additional constraint that we want the output ...
• 38.9k

### A penny saved is a penny

Mathematica, 35 22 bytes Thanks to miles for suggesting FrobeniusSolve and saving 13 bytes. Length@*FrobeniusSolve Evaluates ...
• 197k

### Sum of five cubes

Brachylog, 11 bytes Thanks Fatalize for saving one byte ~+l₅≥₁.√₃ᵐ∧ Try it online! Firstly ~+ enforces that the output (<...
• 11.6k

### Number of coins needed to make change

JavaScript (ES7),  36  35 bytes Similar to other answers. Using a Black Magic formula instead of a lookup table. f=n=>n&&(n%10)**29%3571%4+f(n/10|0) ...
• 193k

### Number of coins needed to make change

Husk, 11 9 8 bytes Edit: -1 byte thanks to caird coinheringaahing ṁo⌈½ṁB5d Try it online! ...
• 34.9k
Accepted

### A penny saved is a penny

Jelly (fork), 2 bytes æf This relies on a branch of Jelly where I was working on implementing Frobenius solve atoms so unfortunately you cannot try it online. ...
• 16.9k
Accepted

### How many partitions do I have?

Pyth, 3 bytes l./ Try it here! or Try a test Suite. The answer took much longer to format than writing the code itself :P. How? Pyth is the right tool for the job....
• 42.4k

### Non-sums of distinct positive powers

APL(Dyalog Unicode), 26 bytes SBCS ⊢{z~∊(⊢,+)\⍺*⍨z←⍳!⍵}!×2*×⍨ Try it on APLgolf! This only works theoretically in multiple ways. The upper bound used (factorial of ...
• 77k

Haskell, 37 bytes f 0=[[]] f n=[a:x|a<-[1..n],x<-f$n-a] xnor saved two bytes. • 68.8k 12 votes ### A penny saved is a penny Pyth, 8 bytes /sM{yS*E Raw brute force, too memory intensive for actual testing. This is O(2mn), where n is the number of coins and m is the target sum. Takes ... • 17.9k 11 votes ### Yo boy, must it sum Python 2, 82 79 bytes f=lambda n:min([f(n-k)+[k]for k in range(1,n+1)ifk==k[::-1]]or[[]],key=len) Try it online! • 210k 11 votes ### Display a number in Toki Pona Python 2, 81 bytes lambda n:n/100*'ale '+n/20%5*'mute '+n/5%4*'luka '+n%5/2*'tu '+n%5%2*'wan'or'ala' Try it online! The naive approach is surprisingly effective. ... • 22.7k 10 votes ### List all ordered partitions of n Python, 56 bytes f=lambda n:[x+[n-i]for i in range(n)for x in f(i)]or[[]] A recursive solution: The ordered partitions of n ... • 145k 10 votes ### List all ordered partitions of n Python 2, 61 bytes f=lambda n,s='1,':1/n*[eval(s)]or f(n-1,'1+'+s)+f(n-1,'1,'+s) This isn't the shortest, but I really like the method because it's so weird. ... • 145k 10 votes ### Fewest operations to 100 JavaScript (ES6), 153 176 bytes EDIT: In non-strict mode, JS interprets 0-prefixed numerical expressions as octal (e.g. 017 is parsed as 15 in decimal). This is a ... • 193k 10 votes ### How many partitions do I have? Emojicode 0.5, 204 201 bytes 🐋🚂🍇🐖🅰️➡🚂🍇🍊⬅🐕1🍇🍎1🍉🍮s 0🔂k⏩0🐕🍇🍦t➖🐕k🍮r t🔂i⏩1 t🍇🍊😛🚮t i 0🍇🍮➕r i🍉🍉🍮➕s✖r🅰️k🍉🍎➗s🐕🍉🍉 Try it online! -3 bytes ... • 5,693 10 votes ### Sum of combinations with repetition Python 2, 46 45 bytes thanks to xnor for -1 byte f=lambda n:n>0and f(n-2)+f(n-3)+f(n-5)or n==0 Try it online! • 59.5k 10 votes ### Sum of five cubes Python 2, 58 57 54 bytes def f(n):k=(n**3-n)/6;return[v**3for v in~k,1-k,n,k,k] Try it online! -2 bytes, thanks to Rod -1 byte, thanks to Neil • 19.8k 10 votes Accepted ### Calculate Landau's function 05AB1E, 6 bytes Åœ€.¿Z Try it online! ... • 15.7k 10 votes ### Calculate Landau's function Wolfram Language (Mathematica), 44 bytes Max[PermutationOrder/@Permutations@Range@#]& Try it online! Wolfram Language (Mathematica), 31 bytes @... • 1,983 10 votes ### Number of coins needed to make change Haskell, 55…41 40 bytes -1 byte thanks to xnor, for using a string instead of the hard-coded list. a=0:tail[i+read[j]|i<-a,j<-"0112212233"] Try ... • 6,266 10 votes ### AoCG2021 Day 14: Adjusting dancing program's period Pari/GP, 59 bytes (n,m)->[[lcm(Vec(concat(p,q)))==m|q<-s]|p<-s=partitions(n)] Try it online! Let x and ... • 48.5k 9 votes ### A penny saved is a penny JavaScript (ES6), 51 48 bytes f=(n,a,[c,...b]=a)=>n?n>0&&c?f(n-c,a)+f(n,b):0:1 Accepts coins in any order. Tries both using and not using the first ... • 172k 9 votes ### A penny saved is a penny Haskell, 37 bytes s%(h:t)=sum$map(%t)[s,s-h..0] s%_=0^s Using some multiple of the first coin h decreases the required sum <...
• 145k

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