Posts by Shaggy
Japt, 15 bytes Port of m90's JS solution, until I manage to come up with something shorter. ;Bg7^Mm8|#ÿ^3îU Try it
JavaScript, 36 bytes n=>n==(g=d=>--d?(n%d?1:d)*g(d):1)(n) Try it online!
Japt v1.4.5, 4 bytes ¶â¬× Try it ¶â¬× :Implicit input of integer ¶ :Is equal to ⬠:Proper divisors × :Reduced by multiplication
JavaScript, 25 bytes Input as an array of digits a=>a.map(x=>t+=x%2,t=0)|t Try it online! 26 bytes With input as a string (or an array of digit strings). f=([d,...a])=>d?d%2+f(a):0...
Japt -mx, 2 1 byte u Try it u :Implicit map of input array u :Modulo 2 :Implicit output of sum of resulting array
Japt, 17 bytes 0-indexed gU²o!gM fÈì äa eÉ Try it 15 bytes 1-indexed @µXì äa eÉ}f!gM Try it
JavaScript, 42 bytes s=>(g=n=>--n&&s.includes(s%n?g:n)|g(n))(s) Try it online!
Japt v1.4.5, 7 bytes â¬d!øUs Try it â¬d!øUs :Implicit input of integer U ⬠:Divisors, excluding itself d :Are any !ø : Contained in Us : The s...
JavaScript, 104 102 99 bytes I/O as a character array. a=>a.filter(x=>a<g(x)&g(x)<a[~-a.length],a=a.map(g=x=>[...Buffer(x)[0].toString(2)].sort()).sort()) Try it online!
Japt, 9 bytes ô rÈÔÅÔcY Try it or run all test cases ô rÈÔÅÔcY :Implicit input of array ô :Split on falsey elements (i.e., 0) r :Reduce by È :Passing...
JavaScript, 52 51 28 bytes s=>Buffer(s).map(x=>x|32)+`` Try it online! -1 byte thanks to trichoplax.
JavaScript, 31 bytes Outputs 0 for falsey and a non-zero value for truthy. If the 2 values must be consistent then replace the last * with && to output true instead. n=>(g=d=>d++&...
Rockstar, 40 bytes listen to N say "listen to N say N-0+"+N Which outputs P2, where X is the input from P1: listen to N say N-0+X Try it here (Code will need to be pasted in)
JavaScript, 26 bytes Outputs the nth term, 0-indexed. f=n=>n<2?n:f(--n)*2+f(--n) Try it online! JavaScript, 49 bytes Outputs the first n terms as a comma delimited string. f=n=>...
Japt, 10 bytes Outputs a 2D-array. 9õ ñu3 £éX Try it 9õ ñu3\n£éX 9õ :Range [1,9] ñ :Sort by u3 : Mod 3 of each \n :Assign to variabl...
Japt, 15 14 bytes @§XnÈj}aX+j}a2 Try it or run all test cases @§XnÈj}aX+j}a2 :Implicit input of integer U @ :Function taking an integer X as argument § ...
- ← Previous
- 1
- 2
- 3
- 4
- 5
- Next →