Divisiblity of seven digits

Let A A be the set of all 7-digit numbers which use distinct digits 1 , 2 , 3 , 4 , 5 , 6 1, 2, 3, 4, 5, 6 and 7 7 . How many ordered pairs ( x , y ) (x,y) are there such that both x x and y y are in A A and x x divides y y ?


The answer is 5040.

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.

1 solution

Fletcher Mattox
Aug 6, 2020

Only the 5040 permutations of x = = y x == y .

1
2
3
4
5
6
7
from itertools import permutations
N = []
for t in permutations([str(i) for i in range(1,8)]):
    n = int(''.join(t))
    N.append(n)
pairs = [[ (i,j) for i in range(len(N)) if N[i] % N[j] == 0] for j in range(len(N))]
print(len(pairs))

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...