Project Euler Homework
Functions

043.cpp File Reference

The number, 1406357289, is a 0 to 9 pandigital number because it is made up of each of the digits 0 to 9 in some order, but it also has a rather interesting sub-string divisibility property. More...

#include <iostream>
#include "043_permutation.h"
#include <set>

Go to the source code of this file.

Functions

unsigned slice_perm (perm043 &perm, idx begin, idx end)
unsigned long long sum (set< unsigned > &numbers)
int main ()

Detailed Description

The number, 1406357289, is a 0 to 9 pandigital number because it is made up of each of the digits 0 to 9 in some order, but it also has a rather interesting sub-string divisibility property.

Let d1 be the 1st digit, d2 be the 2nd digit, and so on. In this way, we note the following:

Find the sum of all 0 to 9 pandigital numbers with this property.

Definition in file 043.cpp.


Function Documentation

unsigned slice_perm ( perm043 perm,
idx  begin,
idx  end 
)

extract subset of digits, and convert to integer.

Parameters:
permobject containing the permutation
beginstarting position
endending position
Returns:
an integer having (end-begin) digits.

Definition at line 24 of file 043.cpp.

 All Classes Files Functions Variables