Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
projecteuler
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
projecteuler
Commits
fadf1e2b
Commit
fadf1e2b
authored
Dec 06, 2012
by
Taddeüs Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Solved 47
parent
7487ab6a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
problem47.py
problem47.py
+28
-0
No files found.
problem47.py
0 → 100755
View file @
fadf1e2b
#!/usr/bin/env python
from
__future__
import
division
from
utils
import
primes_until
primes
=
list
(
primes_until
(
10000
))
def
distinct
(
n
,
frm
=
0
):
for
i
,
p
in
enumerate
(
primes
[
frm
:]):
div
=
n
/
p
if
div
<
2
:
break
if
div
.
is_integer
():
others
=
set
([
int
(
div
)])
if
div
in
primes
[
i
:]
else
distinct
(
div
,
i
)
if
others
:
return
others
|
set
([
p
])
n
=
N
=
4
counter
=
0
while
counter
!=
N
:
factors
=
distinct
(
n
)
counter
=
counter
+
1
if
factors
and
len
(
factors
)
==
N
else
0
n
+=
1
print
n
-
N
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment