Hot answers tagged

11 votes

Palindromic Powers

Desmos, 177 175 bytes ...
user avatar
  • 3,821
9 votes

ASCII-Art n'th Root

Python, 143 bytes def f(a,b): A=len(str(-a))&-2;print(A*" ",len(str(b))*"_"+f"\n{a:<{A}}/{b} = {b**(1/a):.{A}}");p="\\" while A:A-=2;print(p+A*" &...
user avatar
  • 5,740
8 votes

Palindromic Powers

05AB1E, 11 bytes <TŸʒÓ¿≠yÂQ& Try it online! Before Kevin wakes up and outgolfs me. Port of Jelly. How? ...
user avatar
  • 3,856
8 votes

There's more than one way to skin a set

BQN, 15 bytesSBCS (1=⊒)⊸/·⥊(∾∾+)˝ Run online! BQN, 19 bytesSBCS (1=⊒)⊸/<+´∘ר⟜⥊⟜↕2¨ Run online! ...
user avatar
  • 53.4k
7 votes

Rounding a range

Python, 44 bytes lambda a,b:(m:=(a+b+1-(l:=int(b-a)))//2,m+l) Attempt This Online! Old Python, 50 bytes lambda a,b:(m:=(a+b+~(l:=int(b-a))%2)//2-l//2,m+l) Attempt This Online! Old Python, 56 bytes ...
user avatar
  • 5,740
7 votes

There's more than one way to skin a set

Wolfram Language (Mathematica), 34 bytes ##2&@@@Gather[Tr/@Subsets@#]⋃{}& Try it online! ...
user avatar
  • 15k
6 votes

ASCII-Art n'th Root

JavaScript (ES8),  158  156 bytes Expects (a)(b), where both arguments are strings. ...
user avatar
  • 166k
6 votes

ASCII-Art n'th Root

Lua, 205 203 188 bytes ...
user avatar
  • 409
6 votes

ASCII-Art n'th Root

Charcoal, 37 bytes θ⸿↘⊘⊕Lθ↑↗⊘⁺³Lθ⟦⭆η_⟧η = ﹪⁺⁺%.LθfXIη∕¹N Try it online! Link is to verbose version of code. Explanation: θ ...
user avatar
  • 142k
6 votes

Palindromic Powers

Jelly, 13 bytes ’⁵rŒḂƇÆEg/’ƊƇ Try it online! -1 byte thanks to Jonathan Allan! In order for some \$k = p_1^{e_1}p_2^{e_2}\cdots p_i^{e_i}\$ to be a perfect power (...
user avatar
5 votes

Print 0 to 100 without 1-9 characters

Vyxal jHRM, 0 bytes Try it Online! Kinda cheating, but whatever. How? ...
user avatar
  • 3,856
5 votes

Sequence of integers not the sum of powers of earlier terms

Python 3, 121 107 105 102 101 bytes -3 inspired by Neil's comments, and another -1 thanks to Neil! Prints the sequence indefinitely. Runs out of memory before finding 25 on TIO. ...
user avatar
  • 53.4k
5 votes

ASCII-Art n'th Root

Python 3.8 (pre-release), 161 bytes ...
user avatar
  • 5,346
5 votes

ASCII-Art n'th Root

Julia 1.0, 137 bytes ...
user avatar
  • 4,824
5 votes

There's more than one way to skin a set

Vyxal, 8 bytes ṗṠsĠ~Ḣvh Try it online or run all test cases. sĠ~Ḣvh is the shortest way I can think of to keep only duplicates, ...
user avatar
  • 3,856
5 votes

There's more than one way to skin a set

R, 66 bytes \(S,t=table(unlist(Map(\(i)combn(S,i,sum),seq(!S)))))names(t[t>1]) Attempt This Online!
user avatar
  • 10.8k
4 votes

Output the sign

Piet + ascii-piet, 19 bytes (4×6=24 codels) tabraF krbtKbks?Tbb Try Piet online! (previous record: 40 codels/ascii-piet bytes) An approach involving a CC+ turned ...
user avatar
  • 62.1k
4 votes

ASCII-Art n'th Root

Python, 169 bytes def f(a,b):print(" "*((A:=len(str(a)))-1+(x:=A%2)),"","_"*len(str(b))+f"\n{a}{x*' '}/{b} =",round(b**1/a,A),*("\n"+i*" &...
user avatar
  • 1,172
4 votes

ASCII-Art n'th Root

C (gcc), 222 218 bytes -4 bytes thanks to @ceilingcat ...
user avatar
4 votes

Palindromic Powers

Wolfram Language (Mathematica), 60 bytes Select[h=Range[#-1],(h[[a#]]=a=h[[#]])<#>9&&PalindromeQ@#&]& Try it online! ...
user avatar
  • 15k
4 votes

Palindromic Powers

Factor + math.primes.factors project-euler.common, 101 102 bytes ...
user avatar
  • 8,668
4 votes

There's more than one way to skin a set

JavaScript (V8), 69 bytes a=>(g=([v,...a],s=0)=>v?g(a,s+v)|g(a,s):(g[s]=-~g[s])-2||print(s))(a) Try it online! Commented ...
user avatar
  • 166k
4 votes

There's more than one way to skin a set

J, 28 19 bytes [:~.@(#~1-~:)(,,+)/ Try it online! -9 thanks to ovs for the (,,+)/ trick for calculating all subset sums! ...
user avatar
  • 26.5k
3 votes

Sort by Multiplying

TI-Basic, 43 40 37 bytes Prompt A For(I,1,dim(ʟA ʟA(I)(1+int(Ans/ʟA(I→ʟA(I End ʟA -6 bytes thanks to MarcMush.
user avatar
  • 1,841
3 votes

Music with pi and e

Vyxal, 29 bytes ƛkAf7Ẏ2Ǔ:3Ẏ\'vJJn∆iin∆i›∆ė4/" Try it Online! or Run both test cases! Port of 05AB1E. If it can't output rationals instead of decimals, add <...
user avatar
  • 3,856
3 votes

Print 0 to 100 without 1-9 characters

Desmos, 25 bytes o=0 o->[0...eeeln(eeeee)] Not sure if this is an acceptable form of output but it's still an interesting answer imo. Click the right arrow (<...
user avatar
  • 3,821
3 votes

Sequence of integers not the sum of powers of earlier terms

Jelly, 24 22 bytes *þṀŻ$ZŒpŒP€Ẏ§‘ḟ$Ṃ; ⁸Ç¡ Try it online! Takes \$n\$ via STDIN and outputs the first \$n\$ terms in reverse order. +1 byte if the output has to be ...
user avatar
3 votes

Sequence of integers not the sum of powers of earlier terms

Jelly, 22 bytes -rṀṗL‘a*@ɗ⁸§‘ḟ$Ṃ;@ ⁸Ç¡ A full program that accepts an integer, n, from STDIN and prints the Jelly ...
user avatar
3 votes

Rounding a range

Factor + math.unicode, 44 bytes [ 2dup - ⌊ -rot 1 + + over - 2 /i tuck + ] Try it online! Takes input as ...
user avatar
  • 8,668
3 votes

Rounding a range

05AB1E, 16 14 bytes O>I`αï©-2÷D®+‚ -2 bytes porting @loopyWalt's Python answer; make sure to upvote him as well! Try it online or verify all test cases. ...
user avatar

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