Project Euler Solutions
Functions | Variables
python.p0118 Namespace Reference

Functions

def is_not_pandigital
 
def main ()
 

Variables

 all_digits = set("123456789")
 
dictionary max_digits
 

Detailed Description

Project Euler Problem 118

This one doesn't look pretty, but it was much faster to roll out my own loop than try to make combinations() work here.
It's also more efficient because it recycles some of the number generation.

Problem:

Using all of the digits 1 through 9 and concatenating them freely to form decimal integers, different sets can be
formed. Interestingly with the set {2,5,47,89,631}, all of the elements belonging to it are prime.

How many distinct sets containing each of the digits one through nine exactly once contain only prime elements?

Function Documentation

def python.p0118.is_not_pandigital (   numbers)

Here is the caller graph for this function:

def python.p0118.main (   int)

Here is the call graph for this function:

Variable Documentation

python.p0118.all_digits = set("123456789")
dictionary python.p0118.max_digits
Initial value:
1 = {
2  2: 8,
3  3: 7,
4  4: 6,
5  5: 5,
6  6: 3,
7 }