Permalink
Browse files

ups

  • Loading branch information...
1 parent f000c3b commit 427e40eff0c42ef550bced7a94fc1a0eb1e568c3 @zeeshanlakhani committed Jul 7, 2011
Showing with 17 additions and 5 deletions.
  1. +17 −0 prob3.py
  2. +0 −5 test.py
View
@@ -0,0 +1,17 @@
+import sys
+from math import ceil
+
+def main(n):
+ if n == 2:
+ return 2
+ if n % 2 == 0:
+ return main(n/2)
+ for i in xrange(3,int(ceil(n ** 0.5)),2):
+ if n % i == 0:
+ return main(n/i)
+ return n
+
+if __name__ == "__main__":
+ arg = sys.argv[1]
+ largest_prime = main(int(arg))
+ print largest_prime
View
@@ -1,5 +0,0 @@
-"""File docstring"""
-
-def hello():
- """The method's docstring"""
- print "hello world"

0 comments on commit 427e40e

Please sign in to comment.