# Tag Info

### Sum-of-four-squares grid

sed 4.2.2 -r, 1303 1252 1201 1053 838 764 710 681 629 615 bytes ...
• 1,215

### Calculate the sum of numbers in a rectangle

Python 3.8 (pre-release),  99   79   74   73   70   68  67 bytes -20 bytes by removing the auxiliary t lambda, since it was only used once. -5 bytes thanks to ...

### Calculate the sum of numbers in a rectangle

Python, 61 59 bytes f=lambda a,b,c,d:c<d and((c+b)**3-b)/6+b*c-f(b,a,c+(b<a),d) Attempt This Online! Takes top incl, bottom excl, left incl, right excl. How? ...
• 3,724

### Shift right by half a trit

Python 3, 55 bytes f=lambda n,c=1:n>c and f(n,c*3)or[0,(n+c)//3,n-c][n//c] Try it online! The termination condition n>c ...
• 146k

### Calculate the sum of numbers in a rectangle

Python 3, 75 bytes Just wanted to see how far a closed formula can go. Uses the same inclusive bounds as in the question, in slightly different order. ...
• 60.1k

### Shift right by half a trit

Jelly,  13  10 bytes -3 bytes porting Dominic van Essen's implementation of my approach. b3ḢḂȧ%3¬)S Try it online! Or see the test-suite. How? ...
• 109k

### Calculate the sum of numbers in a rectangle

JavaScript (Node.js), 55 bytes f=(x,y,X,Y)=>X?x<X&&f(y,x,Y)+f(x+1,y,X,Y):x-(y+=x)*~y/2 Try it online!
• 26k
Accepted

### How many ways can you make change?

Jelly, 15 14 bytes ŒṗịŒp€ẎṢ€Qɓ;Ṭ} Try it online! Oh yeah... Given n on the left and the objects (with no 0 list!) on the right, outputs the nth collection of ...
• 22.1k

### Shift right by half a trit

JavaScript (Node.js), 34 bytes f=n=>n<2?0:!(n/3^f(1+f(--n)))+f(n) Try it online! Self is slow, but can save states to fasten JavaScript (Node.js), 47 bytes ...
• 26k

### Sum-of-four-squares grid

05AB1E, 50 49 bytes ∞Íonîü2íεU0LsãεXô}Σ˜O]í€.Δ[D˜g5‹#2δô2ô€øOOn}OOQ Brute-force. Generates all $2^k\times 2^k$ sized matrices consisting of 0s and 1s, and will ...
• 129k

### Sum-of-four-squares grid

Pyth, 48 bytes M?Gho_SsNmsCMc2sgLtGdfqHs*VTT^UhH4]]Hgf>2eSsgTQZ Try it online! Can run up to about 30 before timing out online. Try a more performant, 5 byte ...
• 4,697

### How many ways can you make change?

JavaScript (V8), 80 bytes Expects (list_of_lists)(n) without any list for weight 0. Outputs by printing comma-separated strings. ...
• 195k

### How many ways can you make change?

Charcoal, 52 bytes ⊞υ⊞ＯＥθκωＦυ≡§Ｉ⁻↨Ｅ§ι±¹§θκ¹η⁰0…⮌ι¹-¿⊖Ｌι⊞⊞ＯυΦιλ⊞Ｏι⁺⊟ι§ι⁰ Attempt This Online! Link is to verbose version of code. Takes the collection as a ...
• 174k

• 3,628

### Shift right by half a trit

Nekomata + -n, 10 bytes R~3DᵉlhÖ*ž Attempt This Online! A port of @Dominic van Essen's implementation of @Jonathan Allan's ...
• 49.3k

### Calculate the sum of numbers in a rectangle

Python 3, 73 bytes lambda a,b,c,d:(e:=c-a)*(f:=d-b)*(e*e+f*f+3*(~a-b-c-d)**2-12*(a+c)-17)/24 Try it online! I tried golfing a closed formula (independently of ovs)...
• 146k

### How many ways can you make change?

05AB1E, 18 bytes FĆ}¹Åœèε.«âεS{]€Ù Inputs in the order $n,objectLists$, including an empty list at index 0. Assumes the objects are always single characters (...
• 129k

### Rabinowitz-Wagon $\pi$ formula

R, 74 61 bytes ~=\(n,m=1)if(m>n,1,(a=n~m+1)[1]*(2*m+1)+m*a*0:1)*1:2^!m-1 Attempt This Online! Recursive approach to construct the Rabinowitz-Wagon formula ...
• 36.2k

Wolfram Language (Mathematica), 71 bytes If[#==0,{},{a=⌊++j#⌋,##&@@#0[j#-a]}]&@Tr[Tr[i=j=1;#/++i!&/@#]&/@#]& Try it online! Input ...
• 21.3k

### Dijkstra's Challenge

Uiua, 11 bytes ⧻⊚×⊸=/+°⍉°⊡ Try it online! Explanation ...
• 101

### Cubic Concatenation

Excel, 23 Bytes An anonymous workbook function that takes input from a vertical array at A1# and outputs to the calling cell ...
• 8,686

### Cubic Concatenation

ARBLE, 21 bytes a^3+b^3+c^3-(a..b..c) 0 for truthy, non-zero for falsey. Try it online! Run all tests!
• 10.9k

### Shift right by half a trit

R, 41 40 bytes ?=\(n)if(n<2,0,(k=?n-1)+!n%/%3-?1+k) Attempt This Online! Port of @l4m2's JS answer. Slightly ungolfed: ...
• 17.8k

### Shift right by half a trit

05AB1E, 15 bytes _+3Bć©3αì®i¨}3ö Try it online or verify all test cases. Explanation: ...
• 129k

### Shift right by half a trit

Nibbles, 18 nibbles (9 bytes) ,|,$~*%$3- 2/@3 Attempt This Online! An implementation of Jonathan Allan's approach of counting elements of A003605 up to ...
• 36.2k

### Sum-of-four-squares grid

Charcoal, 101 bytes Ｎθ≔⦃⁰⟦0⟧¹⟦1⟧⦄ηＷ∧¬§ηθη«≔⦃⦄η≔ＥιλζＦζＦζＦζＦζ«≔ΣＸ⟦νμλκ⟧²ε≔⁺Ｅ§ιν⁺ξ§§ιμπＥ§ιλ⁺ξ§§ικπδ¿∨¬§ηε‹ΣΣδΣΣ§ηε§≔ηεδ»»§ηθ Attempt This Online! Link is to verbose ...
• 174k

### Calculate the sum of numbers in a rectangle

Desmos, 49 bytes f(a,b,c,d)=∑_{x=a}^b∑_{y=c}^d((x+y)^2+3x+y)/2 Order: inclusiveLeftX, inclusiveRightX, inclusiveTopY, inclusiveBottomY Try it online

### Calculate the sum of numbers in a rectangle

Jelly,  11  9 bytes -2 thanks to Unrelated String (use of the table hyper, þ, to avoid separately taking the Cartesian product with ...
• 109k