summaryrefslogtreecommitdiff
path: root/progs/a485.py
diff options
context:
space:
mode:
Diffstat (limited to 'progs/a485.py')
-rw-r--r--progs/a485.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/progs/a485.py b/progs/a485.py
new file mode 100644
index 0000000..20165f4
--- /dev/null
+++ b/progs/a485.py
@@ -0,0 +1,15 @@
+MAX = 3000
+def smartNumber(n):
+ primes = [0] * MAX
+ result = []
+ for i in range(2, MAX):
+ if (primes[i] == 0):
+ primes[i] = 1
+ j = i * 2
+ while (j < MAX):
+ primes[j] -= 1
+ if ( (primes[j] + 3) == 0):
+ result.append(j)
+ j = j + i
+ result.sort()
+ return result[n - 1] \ No newline at end of file