76
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.
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 ...
71
votes
Fibonacci-orial
Mathematica, 10 bytes
Fibonorial
Another Mathematica built-in soundly beaten by a golfing language without the built-in.
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{...
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
...
58
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 ...
53
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 ...
49
votes
Fibonacci + Fizz Buzz = Fibo Nacci!
Python 2, 62 bytes
a=b=1;exec"print~a%2*'Fibo'+~a%3/2*'Nacci'or a;a,b=b,a+b;"*100
Not much different from the standard FizzBuzz, really.
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\$ ...
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\$ ...
47
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
(...
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 ...
46
votes
Calculate Phi (not Pi)
Regex (.NET), 122 113 bytes
^(?=((?=.*$(?<=^(\3+(.+.))(.*?(?>(.\4)?)))).)+(.*))((?=.*(?=\6$)(?<=(?!(.+.)\8*(?=\6$)(?<=^\8+))(.+?(?>\9?)))).)+
...
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 ...
44
votes
Fibonacci reversed!
Mathematica, 25 bytes
InverseFunction@Fibonacci
Function. Pretty self-explanatory if you ask me.
44
votes
One OEIS after another
22. FiM++, 982 bytes, A000024
Note: if you are reading this, you might want to sort by "oldest".
...
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 ...
41
votes
Accepted
Prime counting function
05AB1E, 3 bytes
!fg
This assumes that factorization built-ins are allowed. Try it online!
How it works
...
39
votes
Accepted
Print a bunch of uninteresting numbers!
05AB1E, 3 bytes
Ы*
Explained
Ð # triplicate input
« # conactenate
* # multiply
Try it online
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, ><>, ...
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.
...
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 ...
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 ...
35
votes
34
votes
Patience, young "Padovan"
Jelly, 10 9 8 bytes
ŻṚm2Jc$S
A monadic Link accepting n (0-indexed) which yields P(n).
...
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 ...
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 ...
32
votes
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
sequence × 920code-golf × 847
number × 241
math × 229
number-theory × 112
integer × 91
primes × 71
combinatorics × 70
arithmetic × 60
fibonacci × 47
binary × 41
string × 38
subsequence × 32
code-challenge × 31
cops-and-robbers × 30
base-conversion × 27
decision-problem × 26
array × 23
kolmogorov-complexity × 21
fastest-code × 20
geometry × 19
permutations × 19
grid × 16
palindrome × 13
open-ended-function × 13