100% Guaranteed Results


Project
$ 29.99
Category:

Description

5/5 – (1 vote)

This problem is a programming version of Problem 43 from projecteuler.net
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:
d2d3d4 is divisible by 2 d3d4d5 is divisible by 3 d4d5d6 is divisible by 5 d5d6d7 is divisible by 7 d6d7d8 is divisible by 11 d7d8d9 is divisible by 13 d8d9d10 is divisible by 17
Find the sum of all 0 to N pandigital numbers with this property.
Input Format
Input contains an integer N
Output Format
Print the answer corresponding to the test case.
Constraints
3 ≤ N ≤ 9
Sample Input

Sample Output

Reviews

There are no reviews yet.

Be the first to review “Project”

Your email address will not be published. Required fields are marked *

Related products