# Search Results

Results tagged with Search options user 18638
14 results

The challenge involves mathematics. Also consider using more specific tags: [number] [number-theory] [arithmetic] [combinatorics] [graph-theory] [geometry] [abstract-algebra].

J (20): Not quite complying with the rules as they are now, but hey... JS isn't either ;) }.(1=a+.i.101)#i.101 Showcase: a=:3 }.(1=a+.i.101)#i.101 2 4 5 7 8 10 11 13 14 16 17 19 20 22 23 25 …
answered Jun 1 '14 by ɐɔıʇǝɥʇuʎs
Python (73): Can probably be golfed a heck of a lot more. i=0 while 1: i+=1;j=i;k=0 while j!=1:j=(j/2,j*3+1)[j%2];k+=1 print i,k
answered Apr 4 '14 by ɐɔıʇǝɥʇuʎs
Python 59-25-50-10 (-100): -26 (or -126, again: depending on how you see P2's input()) Oh wait, xrange supports things outside of range's scope. One character extra for 25 bonus points? Sure! sum( …
answered Mar 16 '14 by ɐɔıʇǝɥʇuʎs
J (between 2 and 32) I'm not quite clear on i/o format, but I think C. would do, if the following output would be accepted: C. 0 1 3 4 5 6 7 2 ┌─┬─┬───────────┐ │0│1│7 2 3 4 5 6│ └─┴─┴─────────── …
answered Aug 13 '14 by ɐɔıʇǝɥʇuʎs
Python It's legit, I swear! eval=len print eval("2 + 2")
answered Jun 9 '14 by ɐɔıʇǝɥʇuʎs
Python (3) Since there are quite a few of these questions these days, I decided to make a program to automatically solve them in 3 (or 2) tokens. Here's the result for this challenge: G:\Users\Synth …
answered Jul 17 '14 by ɐɔıʇǝɥʇuʎs
Python + networkx (Bruteforce, checks about 10000 paths per second on my machine) It's not fast, but it works at least. Checks literally every path. Amount of cycles necessary can be found here. Th …
answered Jun 26 '14 by ɐɔıʇǝɥʇuʎs
Python 2 (46+271=327) Code: print open('f').read().decode('zip').split(';')[input()] File f, containing the following binary garbage (these are the char codes) 120, 156, 101, 146, 219, 21, 195, 3 …
answered Sep 11 '14 by ɐɔıʇǝɥʇuʎs
J x=:!123 x=x+2 1 This is also reliant on the floating point trick: !123x=2+!123x returns 0(= actually is the comparison operator, so no trickery there) Or, maybe even better: x=:_ x= …
answered Jun 9 '14 by ɐɔıʇǝɥʇuʎs
J (34) This should work I think. It would be nice if you gave some test cases... f=:~:/ .*&.(8 8&\$@(_64&{.) :.,@#:) This works with the test cases supplied in the comments (when changing 8 8 to 4 …
answered Aug 20 '14 by ɐɔıʇǝɥʇuʎs
J (10) Very, very, very inspired by the answer of @Dennis: <.@%~^&1.5 And a slightly longer, but with better performance (I suspect): <.@(-:&.^.) floor(halve under log) To execute, indented pa …
answered Sep 1 '14 by ɐɔıʇǝɥʇuʎs
I came across this the other day. I don't take credit for it, but damn, is it awesome: Python 2: _ = ( 255, …
answered Mar 8 '14 by ɐɔıʇǝɥʇuʎs
1990 - J Task 1: Hello World! 'J was made in 1990!' This reflects the typical use of J: in an REPL, this would echo the string back at you. Not very useful in general, but exactly what we want her …
answered Apr 20 '15 by ɐɔıʇǝɥʇuʎs
J (20) This turned out longer than I hoped or expected.Still: shorter than haskel! */@:^"1#:@i.@(2&^)@# Usage: f=:*/@:^"1#:@i.@(2&^)@# f 2 3 5 7 1 7 5 35 3 21 15 105 2 14 10 70 6 42 30 21 …
answered Nov 27 '14 by ɐɔıʇǝɥʇuʎs