0WJYxW9FMN
  • Member for 5 years, 6 months
  • Last seen more than 2 years ago
Do n and n^3 have the same set of digits?
29 votes

Python 3, 36 32 bytes lambda x:{*str(x)}=={*str(x**3)} I think this only works in Python 3.5 and later. Four bytes have gone, thanks to Copper.

View answer
Binary Substrings
7 votes

Python 3, 54 50 bytes lambda n:sum(bin(i)[2:]in bin(n)for i in range(n)) Thanks to Rod and Jonathan Allan for saving four bytes.

View answer
This is my pillow
7 votes

Brainfuck, 140 bytes >>>++++++++[>++++++>++++++++++++<<-]++++++++++>->----<<<<<+++[>++++[>++++++[>>.....>.....<<<-]>.<<-]++++[...

View answer
Words that Contain Digits
5 votes

Python 3, 150 bytes from itertools import*;lambda x:([i for i in range(10)if(*' OTTFFSSENNWHOIIEIIEORUVXVGN ERE EHE E NT '[i::9],)in[*combinations(x+' ',5)]]+[0])[0] combinations returns all the ...

View answer
Goodness Giza Golf!
5 votes

Python 3, 65 bytes lambda x:len(x)<18and x[:len(x)//2+1]in'0123456789'and x[::-1]==x I'm not entirely sure, but I think this works.

View answer
Count without 3
4 votes

Python 2, 49 44 42 bytes f=lambda x:'3'[:~x%3]in`~x`and f(x+1)or-~x The other Python entry beats this (edit: not any more :-D), but I posted it because I rather like its recursive approach. Thanks to ...

View answer
Numbers that are actually letters
2 votes

Python 3, 28 bytes lambda x:min(hex(x)[1:])>'@'

View answer
Is this number a prime?
1 votes

Python 3, 57 bytes k=int(input());print(all(k%j for j in range(2,k))and k>1) I think it's pretty self-explanatory.

View answer
Make this dice game fair
1 votes

Python, 228 bytes from itertools import*;s,C=lambda x,y:sorted(sum([[i+j for j in y]for i in x],[])),combinations_with_replacement;f=lambda k,l,m:([[*a]for a in C([*C([*range(1,s(l,m)[-1])],k)],2)if(s(...

View answer
Print the f × f times table
1 votes

Python 3, 66 bytes r=range(16) for i in r:print(*[('0'+hex(j*i)[2:])[-2:]for j in r])

View answer
Which Day of Christmas is it?
1 votes

Python 3, 48 46 bytes f=lambda x,i=1:f(x,i+1)if(i+3)*i+2<x/i*6else i

View answer
Minimise the count of prime factors through insertion
0 votes

Python 3, 128 bytes 0-indexed; takes in strings as parameters. -6 bytes thanks to Jonathan Frech. from sympy.ntheory import* def f(n,m):a=[sum(factorint(int(n[:i]+m+n[i:])).values())for i in range(len(...

View answer
Draw an ASCII Rectangle
0 votes

Python 3, 68 bytes def f(a,b): c='|'+'-'*(a-2)+'|\n';print(c+c.replace(*'- ')*(b-2)+c)

View answer
Encode the column cipher
0 votes

Python 3, 48 bytes lambda c,k:''.join([c[i:-1:k]for i in range(k)])

View answer
Divide a number by 3 without using *, /, +, -, % operators
0 votes

Python 3, 61 bytes from numpy import*;f=lambda x:int(base_repr(x,base=3)[:-1],3) This doesn't win, but I think it's a clever method that hasn't been used in the other Python entries, so I'm posting ...

View answer
List of first n prime numbers most efficiently and in shortest code
0 votes

Python 3, 117 106 bytes This solution is slightly trivial, as it outputs 0 where a number is not prime, but I'll post it anyway: r=range for i in[2]+[i*(not 0 in[i%j for j in r(3,int(i**0.5)+1,2)])...

View answer