5 and 7 is not 57

Find the number of all 7-digit numbers formed from 5 and 7, which are divisible by both 5 and 7.

7 3 9 11

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Ramiel To-ong
May 29, 2015

The actual numbers are 5557755, 5577775, 5755575, 5777555, 7555555, 7575575, 7755755, 7757575, 7775775.

Brock Brown
Feb 3, 2015

Quick Python solution:

1
2
3
4
5
6
7
8
9
from itertools import product
def goal(number):
    n = int(''.join(number))
    return n % 5 == 0 and n % 7 == 0
count = 0
for combo in product('57',repeat=7):
    if goal(combo):
        count += 1
print "Answer:", count

Running time: 0.00495 seconds

Nice... But how about you try it with pen and paper ??? :)

Vaibhav Prasad - 6 years, 4 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...