# Tag Info

## Hot answers tagged base-conversion

Accepted

### Binary to decimal converter

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

### 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 ...
• 139k

### xkcd-Style Page Numbering

CJam, 24 23 22 21 19 bytes ri_)2b,,W%{2\#(md}/ This is an O(log n) approach, where n is the input, that completes the last test case instantly. It converts n ...
• 207k

### xkcd-Style Page Numbering

Python 2, 67 bytes def f(n):x=len(bin(n+1))-3;y=2**x-1;return n and n/y*10**~-x+f(n%y) Seems to work for the given test cases. If I've got this right, this ...
• 61.1k

### 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) ...
• 70.6k

### 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 ...
• 207k
Accepted

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

### Balanced Ternary Converter

Python 2: 58 chars n=input() s="" while n:s="0+-"[n%3]+s;n=-~n/3 print s or 0 Generates the balanced ternary digit-by-digit from the end. The last digit is given ...
• 139k
Accepted

### Numbers that are actually letters

Pyth, 43 - 40 = 3 bytes ?&K@J.HQG-JG"Mix"%"Only %sers"?K"lett""numb Test suite This achieves the bonus. Only numbers and ...
• 41.4k

### 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,752
Accepted

• 69.7k
Accepted

### Obfuscating text by cycling ternary digits

Pyth, 23 22 bytes sXc.<sXz=+GdJ^UK3K1KJG Try it online: Regular Input / Test Suite Thanks to @isaacg for one byte. Explanation: ...
• 21.8k
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, Ƥ, ...

### Convert RGB integer value into RGB values

AVR ABI, 0 Quantities larger than the registers in the AVR's registers are represented with multiple registers. So, when passing in a 32-bit 'n' to a function, it is passed as 4x8-bit registers. ...
• 261

### Numbers that are actually letters

Pyth, 6 bytes !-.HQG .HQ # Converts the input to hexadecimal - G # Deletes all letters ! # If empty, output True, else False Test it here
• 43.5k

### 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 ~ ...
• 41.6k