Skip to main content
Share Your Experience: Take the 2024 Developer Survey
77 votes

Print numbers from 1 to 10

C, 36 bytes main(i){while(printf("%d ",i++)<3);} This works because the loop terminates after the first 2 digit number.
xsot's user avatar
  • 5,529
75 votes

The first n numbers without consecutive equal binary digits

Python 2, 36 bytes lambda n:[2**i*2/3for i in range(n)] Try it online! Explanation: The binary representation of \$\frac{2}3\$ is ...
Neil's user avatar
  • 171k
71 votes

Fibonacci-orial

Mathematica, 10 bytes Fibonorial Another Mathematica built-in soundly beaten by a golfing language without the built-in.
Martin Ender's user avatar
71 votes

Patience, young "Padovan"

Jelly, 10 bytes 9s3’Ẓæ*³FṀ Try it online! 1-indexed. Computes the largest element of: $$\begin{bmatrix}0&0&1 \\ 1&0&1 \\ 0&1&0\end{...
lynn's user avatar
  • 68.7k
67 votes

Count up folks!

MarioLANG, 29 bytes ; ) < +====" >:(-[! =====# Try it online! I know my code is sadly super-sad or angry: >:( Happy MarioLANG, 46 bytes ...
Erik the Outgolfer's user avatar
60 votes

Print numbers from 1 to 10

HTML, 44 bytes <ol><li><li><li><li><li><li><li><li><li><li> This is longer than ...
NinjaBearMonkey's user avatar
54 votes

Absolute Sums of Sidi Polynomial Coefficients

Python 2, 43 bytes f=lambda n,k=1:k/n or n*f(n,k+1)+k*f(n-1,k) Try it online! A different approach Ever since I posted this challenge, I tried to come up with a ...
Dennis's user avatar
  • 210k
48 votes

Print numbers from 1 to 10

Bash, 12 characters echo {1..10} Sample run: bash-4.3$ echo {1..10} 1 2 3 4 5 6 7 8 9 10 Bash + coreutils, 10 characters (...
manatwork's user avatar
  • 20.2k
48 votes
Accepted

Is it a Proth number?

Jelly, 5 bytes ’&C²> Try it online! or verify all test cases. Let \$\newcommand{\&}[]{\text{ & }}j\$ be a strictly positive integer. \$j + 1\$ ...
Dennis's user avatar
  • 210k
48 votes

Is it a Proth number?

Python, 22 bytes lambda N:N-1&1-N>N**.5 This is a port of my Jelly answer. Test it on Ideone. How it works Let \$\newcommand{\&}[]{\text{ & }}j\$ ...
Dennis's user avatar
  • 210k
47 votes

An abundance of integers!

Regex (ECMAScript), 1085 855 597 536 511 508 504 bytes Matching abundant numbers in ECMAScript regex is an entirely different beast than doing so in practically any other regex flavor. The lack of ...
Deadcode's user avatar
  • 11.6k
46 votes

Scroll Word's font size selector

Word VBA, 199 147 126 116 102 100 87 85 Bytes Why emulate when you can do?! Declared function in the ThisDocument module that takes input ...
Taylor Raine's user avatar
  • 8,416
44 votes

Fibonacci reversed!

Mathematica, 25 bytes InverseFunction@Fibonacci Function. Pretty self-explanatory if you ask me.
LegionMammal978's user avatar
44 votes

One OEIS after another

22. FiM++, 982 bytes, A000024 Note: if you are reading this, you might want to sort by "oldest". ...
BlackCap's user avatar
  • 3,928
43 votes

Output the missing integer

Python 2, 18 16 bytes +beauty thanks to @Sarge Borsch `99066**2`.strip Try it online! 99066**2 is just a shorter way to ...
Rod's user avatar
  • 18.4k
41 votes
Accepted

Prime counting function

05AB1E, 3 bytes !fg This assumes that factorization built-ins are allowed. Try it online! How it works ...
Dennis's user avatar
  • 210k
39 votes
Accepted

Print a bunch of uninteresting numbers!

05AB1E, 3 bytes Ы* Explained Ð # triplicate input « # conactenate * # multiply Try it online
Emigna's user avatar
  • 53k
39 votes

Polyglot the OEIS!

26 languages: C, C++, Cubically, rk, what, Bash, Morse, Ook!, str, Charcoal, Commercial, S.I.L.O.S, memescript, Forked, TRANSCRIPT, Braingolf, Fission, Arcyou, Beam, Beatnik, Cood, COW, Emoji, ><>, ...
MD XF's user avatar
  • 13.9k
37 votes
Accepted

Can you outgolf me? (Cops section)

Seed, 5861 bytes, score = 5012 / 5861 = 0.85 The sequence is primes (A000040) with offset 1. a(1) = 2, a(2) = 3, a(3) = 5 etc. ...
feersum's user avatar
  • 31.4k
36 votes

Display OEIS sequences

Python 2, 875 sequences print', '.join('%020d'%(10**20/(input()-21004))) Works for 875 of the sequences 21016 (decimal digits of 1/12) through 21999 (decimal ...
xnor's user avatar
  • 145k
36 votes
Accepted

Am I a Fibonacci Number?

Neim, 2 bytes f𝕚 Explanation: f Push an infinite fibonacci list 𝕚 Is the input in that list? Works the same ...
Okx's user avatar
  • 16.4k
34 votes

Patience, young "Padovan"

Jelly,  10 9  8 bytes ŻṚm2Jc$S A monadic Link accepting n (0-indexed) which yields P(n). ...
Jonathan Allan's user avatar
32 votes

Bit run rundown

Python 2, 46 45 bytes f=lambda n,k=1:`k`in bin(n^n/2)and-~f(n,k*10) Try it online! How it works By XORing n and n/2 (dividing by 2 essentially chops off the ...
Dennis's user avatar
  • 210k
32 votes

Oddly Even, Positively Negative

Python 2, 23 bytes lambda n:~n/2+n%2*(n|2) Odd inputs give roughly n/2, even ones roughly ...
xnor's user avatar
  • 145k
32 votes

Print all lexicographically increasing numbers under 10000

Python 2, 56 bytes for n in range(9999): if eval('<'.join(`n`))**n:print n Try it online! Converts each number like 124 ...
xnor's user avatar
  • 145k
32 votes

What's this constructed number's starter?

05AB1E, 7 5 4 bytes >9*н Try it online! ...
Grimmy's user avatar
  • 15.7k
31 votes

Print numbers from 1 to 10

Jelly, 2 bytes ⁵R Explanation ⁵ Return the fifth command line argument or 10 R Range Implicit output
TuxCrafting's user avatar
  • 4,837
31 votes

An abundance of integers!

Python 2, 41 40 bytes n=k=j=input() while~k<0:j-=1;k-=j>>n%j*n Output is via exit code, so 0 is truthy and 1 is falsy. Try it online! How it works ...
Dennis's user avatar
  • 210k

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