New answers tagged primes
1
vote
List prime-factorized natural numbers up to N in ascending order
Rust
Rust port of @Keith Randall's C++ code.
...
2
votes
0
votes
The smallest number with a given water capacity
Japt, 25 23 bytes
Gets slower the larger the expected output.
@¶Xk ü Ë×õÃÕcÈð änÃxÉ}a
Try it or verify the first 30 values in the sequence
...
4
votes
The smallest number with a given water capacity
05AB1E, 15 bytes
∞.ΔÒγPLζðδÚ˜ð¢Q
Try it online or verify four test cases. (It's very slow, so it'll time out for \$n=3\$ or \$n\geq6\$..)
Explanation:
...
3
votes
The smallest number with a given water capacity
Jelly, 18 bytes
ÆF*/€Rz0t€0Fċ0⁼ð1#
A monadic Link that accepts a positive integer and yields a singleton list containing the first number with that capacity
...or ...
1
vote
2
votes
The smallest number with a given water capacity
Charcoal, 66 bytes
NθW¬⁼θω«→≔⟦⟧υ≔ⅈηF…²η«≔Xκ⌕X⁰⮌↨ηκ⁰ζ≧÷ζη¿⊖ζ⊞υζ»≔ΣEυ⁻⌊⟦⌈…υ⊕λ⌈✂υλ⟧κω»Iⅈ
Try it online! Link is to verbose version of code. Too slow on TIO for ...
1
vote
The smallest number with a given water capacity
MATL, 25 bytes
Based on @ovs' J answer.
`@&YF^ttP,wY>]P&vX<-sG+}@
Try it at MATL online!
5
votes
The smallest number with a given water capacity
J, 39 bytes
(]+[~:1#.[:(-~>./\<.>./\.)__^/@q:])^:_~
Attempt This Online!
...
4
votes
5
votes
The smallest number with a given water capacity
JavaScript (ES6), 145 bytes
-21 bytes and faster code thanks to @tsh
...
Top 50 recent answers are included
Related Tags
primes × 348code-golf × 302
number-theory × 90
math × 88
sequence × 75
number × 67
decision-problem × 34
code-challenge × 26
integer × 19
factoring × 19
fastest-code × 15
arithmetic × 11
restricted-source × 11
string × 10
fibonacci × 9
kolmogorov-complexity × 8
ascii-art × 6
binary × 6
base-conversion × 6
cops-and-robbers × 6
source-layout × 5
array × 5
combinatorics × 4
date × 4
permutations × 4