Share Your Experience: Take the 2024 Developer Survey

# Tag Info

Accepted

### Binary to decimal converter

Jelly, 5 bytes DḤ+¥/ Try it online! Explanation The cast D is a monad (single argument function): digits, turning ...
• 68.7k

### Output numbers up to 2^n-1, "sorted"

Python, 53 bytes f=lambda n,i=1:n*[f]and[i]+f(n-1,2*i)+i%2*f(n-1,i-~i) Try it online! The recursive function generates the sorted list as a pre-order walk down ...
• 145k

### What base is this number in?

Python, 27 22 bytes lambda s:(max(s)-8)%39 This requires the input to be a bytestring (Python 3) or a bytearray (Python 2 and 3). Thanks to @AleksiTorhamo for ...
• 210k

### Find the polynomial

Jelly, 3 bytes ‘b@ Try it online! Returns the polynomial as a list of coefficients. Since we know the polynomial has non-negative integer coefficients, f(b) ...
• 71.5k
Accepted

05AB1E, 4 bytes D1ìH Explanation ...
• 1,338

### What base is this number in?

Python, 25 bytes lambda x:int(max(x),36)+1 Defines a lambda that takes the string x. Finds the largest digit in the string (...
• 7,840

### Binary to decimal converter

Python 2, 49 37 31 30 Bytes Now this will take a binary number in a decimal representation, since Python can handle arbitrarily large integers. ...
• 7,872

### What is the reverse (binary) bit number?

Python, 29 bytes lambda n:int(bin(n)[:1:-1],2) Try it online! This is an anonymous, unnamed function which returns the result. First, ...
• 14.7k

### The best base is 10... Let's reach it!

Mathematica, 56 bytes #//.x_/;(b=Max[d=IntegerDigits@x]+1)<11:>d~FromDigits~b& Try it online! (Using Mathics.) I thought I'd check out what the ...
• 197k

### Convert a 32 bit binary IPv4 address to its quad-dotted notation

x86-16 machine code, IBM PC DOS, 54 47 45 bytes Binary: ...
• 11.9k

JavaScript (ES6), 15 bytes s=>'0x1'+s-0||s How it works '0x1'+s converts the input into a literal hexadecimal string with ...

### Output numbers up to 2^n-1, "sorted"

Jelly, 6 bytes Ḷ2*ẆS€ This qualifies for the imaginary bonus. Try it online! How it works ...
• 210k

### Does base n have any Rotate-Left-Double numbers?

05AB1E, 6 5 bytes ÍD<&Ā -1 byte thanks to @xnor and @Noodle9. Try it online or verify the first $[2,100]$ test cases. Explanation: ...
• 127k
Accepted

### What base is this number in?

Jelly, 4 bytes ṀØBi Requires uppercase. Try it online! or verify all test cases. How it works ...
• 210k

### What is the reverse (binary) bit number?

Python, 29 bytes lambda n:int(bin(n)[:1:-1],2) Try it online
• 23.4k

Pure Bash (no external utils), 64 2 bytes saved thanks to @NahuelFouilleul x={A..Z} eval f=($x$x-%03d-$x$x) printf ${f[$1/1000]} $[$1%1000] Try it online! - ...

### Smallest Zeroless Base

Pyth, 6 bytes f*FjQT Verify all the test cases. How it works f*FjQT ~ Full program. f ~ First positive integer where the condition is truthy. jQT ~ ...
• 42.4k
Accepted

### Take a byte out of it!

Jelly, 6 bytes BḄ-8ƤṀ A monadic link taking a number and returning a number. Try it online! How? Uses a nice quick, Ƥ, ...
• 107k

### Up go the bits!

Python 2, 31 bytes f=lambda n:n and 3*f(n/2)+n%2+1 Try it online!
• 210k

• 15.7k

### Output N in base -10

JavaScript (ES6), 51 45 37 bytes f=n=>n&&n%10+((k=n<0)+f(k-n/10|0))*10 Test cases ...
• 193k