Awesome Fractions

17820 495 = 36 \frac{17820}{495} = 36

The above is called an “awesome fraction” because it equals a positive integer and uses each of the digits 0 through 9 exactly once on either side of the equal sign ( = = ).

What is the sum of all integers that can be expressed as awesome fractions?

Note : All integers must be expressed without leading zeros. You may make use of the coding environment below:


            
You need to be connected to run code


The answer is 93550.

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.

10 solutions

Mark Hennings
Jul 14, 2018

We are looking for positive integers a , b , N a,b,N such that N = a b N = ab and such that the numbers a , b , N a,b,N together use all of the digits from 0 0 to 9 9 exactly once. If a a is an r r -digit number and b b an s s -digit number, then N N is a ( 10 r s ) (10-r-s) -digit number. Thus 1 0 r 1 a < 1 0 r 1 0 s 1 b < 1 0 s 1 0 9 r s N < 1 0 10 r s 10^{r-1} \le a < 10^r \hspace{1cm} 10^{s-1} \le b < 10^s \hspace{1cm} 10^{9-r-s} \le N < 10^{10-r-s} We deduce that 1 0 r + s 2 N = a b < 1 0 r + s 10^{r+s-2} \le N = ab < 10^{r+s} and hence either 9 r s = r + s 2 9-r-s = r+s-2 or else 9 r s = r + s 1 9-r-s = r+s-1 . The only viable option is that r + s = 5 r+s = 5 , and hence that N N is a 5 5 -digit number.

Checking the 5 5 digit numbers N N for factor pairs a , b a,b that, together with N N , use all the digits once each, we obtain the following possible values for N N : 15628 15678 16038 17082 17820 19084 20457 20754 21658 24507 26910 27504 28156 28651 32890 34902 36508 58401 65128 65821 \begin{array}{ccccc} 15628 & 15678 & 16038 & 17082 & 17820\\ 19084 & 20457 & 20754 & 21658 & 24507\\ 26910 & 27504 & 28156 & 28651 & 32890 \\ 34902 & 36508 & 58401 & 65128 &65821 \end{array} and, finding the suitable factors of each of these 20 20 numbers, we obtain the list of awesome numbers: 3 4 6 7 27 36 39 45 46 52 54 63 78 297 345 367 396 402 495 594 715 927 3094 3907 4093 5694 5817 6819 6918 7039 8169 9127 9168 9304 9403 \begin{array}{ccccccccc} 3 & 4 & 6 & 7 & 27 & 36 & 39 & 45 & 46 \\ 52 & 54 & 63 & 78 & 297 & 345 & 367 & 396 & 402 \\ 495& 594& 715& 927& 3094& 3907& 4093& 5694& 5817\\ 6819& 6918&7039& 8169& 9127& 9168& 9304& 9403 \end{array} Adding up these 35 35 values gives the answer 93550 \boxed{93550} .

The Mathematica code:

DDQ[n_] := Length[Union[IntegerDigits[n]]] == Length[IntegerDigits[n]]

OKQ[n_ , d_ ] := Sort[Join[IntegerDigits[n], IntegerDigits[d], IntegerDigits[n/d]]] == {0, 1, 2, 3, 4, 5, 6, 7, 8, 9})

NTest[n_] := Apply[Or, OKQ[n, #] & /@ Divisors[n]]

Test[n_] := Select[Divisors[n], OKQ[n, #] &]

ndata = Range[100000]

ndata1 = Select[ndata, DDQ[#] &]

ndata2 = Select[ndata1, NTest[#] &]

ndata3 = Apply[Union, Test[#] & /@ ndata2]

Total[ndata3]

does the work. The contents of ndata2 are the possible values of N N , and the contents of ndata3 the list of awesome numbers.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
def commonality(num1, num2):
    c = 0
    for char1, char2 in zip(num1, num2):
        if char1 != char2:
            c += c
    return c

def factors(n):
    return list(x for tup in ([i, n//i] 
                for i in range(1, int(n**0.5)+1) if n % i == 0) for x in tup)

numerators = []
denominators = []
for i in range(10000,100000):
    if len(set(str(i))) == len(str(i)):
        for j in factors(i):
            if len(set(str(j))) == len(str(j)):               
                if i%j == 0 and commonality(str(i),str(j)) == 0:
                    num_char = len(str(i)+str(j)+str(i/j))
                    unique_chars = len(set(str(i)+str(j)+str(i/j)))
                    if num_char == 10 and unique_chars == 10:
                        print '%d / %d = %d' %(i, j, i/j)
                        numerators.append(i)
                        denominators.append(j)
                        x = i/j

print 'Numerator list(%d ints) = %s' % (len(list(set(numerators))), sorted(list(set(numerators)))) 
print 'Denominator/answers list(%d ints) = %s' % (len(list(set(denominators))), sorted(list(set(denominators))))                         
print 'Sum of numerators = %d' %(sum(list(set(numerators))))
print 'Sum of denominators/answers = %d' %(sum(list(set(denominators))))
print 'Sum of ints = %d' %(sum(list(set(numerators))) + \
        sum(list(set(denominators))))

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
15628 / 4 = 3907
15628 / 3907 = 4
15678 / 39 = 402
15678 / 402 = 39
16038 / 27 = 594
16038 / 594 = 27
16038 / 54 = 297
16038 / 297 = 54
17082 / 3 = 5694
17082 / 5694 = 3
17820 / 36 = 495
17820 / 495 = 36
17820 / 45 = 396
17820 / 396 = 45
19084 / 52 = 367
19084 / 367 = 52
20457 / 3 = 6819
20457 / 6819 = 3
20754 / 3 = 6918
20754 / 6918 = 3
21658 / 7 = 3094
21658 / 3094 = 7
24507 / 3 = 8169
24507 / 8169 = 3
26910 / 78 = 345
26910 / 345 = 78
27504 / 3 = 9168
27504 / 9168 = 3
28156 / 4 = 7039
28156 / 7039 = 4
28651 / 7 = 4093
28651 / 4093 = 7
32890 / 46 = 715
32890 / 715 = 46
34902 / 6 = 5817
34902 / 5817 = 6
36508 / 4 = 9127
36508 / 9127 = 4
58401 / 63 = 927
58401 / 927 = 63
65128 / 7 = 9304
65128 / 9304 = 7
65821 / 7 = 9403
65821 / 9403 = 7
Numerator list(20 ints) = [15628, 15678, 16038, 17082, 17820, 19084, 20457, 20754, 21658, 24507, 26910, 27504, 28156, 28651, 32890, 34902, 36508, 58401, 65128, 65821]
Denominator/answers list(35 ints) = [3, 4, 6, 7, 27, 36, 39, 45, 46, 52, 54, 63, 78, 297, 345, 367, 396, 402, 495, 594, 715, 927, 3094, 3907, 4093, 5694, 5817, 6819, 6918, 7039, 8169, 9127, 9168, 9304, 9403]
Sum of numerators = 593577
Sum of denominators/answers = 93550
Sum of ints = 687127

Michael Fitzgerald - 2 years, 11 months ago

Got it wrong as I was not sure what ints to add up all or denominator/answers...apparently the latter

Michael Fitzgerald - 2 years, 11 months ago
Pietro Toniolo
Jul 17, 2018
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
def test(a,s,n):
    x = int(s[:n])
    y = int(s[n:])

    r = str(x*y)

    if len(r) < 5: return
    for i in range(5):
        if r[i] in s+r[:i]+r[i+1:]: return

    a.add(x)
    a.add(y)

def check(a,s="",n=0):
    if n==5:
        test(a,s,1)
        test(a,s,2)
    else:
        for i in range(10):
            c = str(i)
            if c not in s:
                check(a,s+c,n+1)

a = set()
check(a)
print(sum(a))

Arjen Vreugdenhil
Jul 17, 2018

A traditional solution in C.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#include <stdio.h>

int used[10];

void init() { for (int i = 0; i < 10; i++) used[i] = 0; }

int unq(int n) {
    for (; n > 0; n /= 10)
        for (int m = n / 10; m > 0; m /= 10)
            if (m%10 == n%10) return 0;
    return 1;
}

int valid(int n) {
    for (; n > 0; n /= 10)
        if (used[n%10]) return 0;
    return 1;
}

int complete() {
    for (int i = 0; i < 10; i++) if (!used[i]) return 0;
    return 1;
}

void use(int n) {
    for (; n > 0; n /= 10)
        used[n%10] = 1;
}

void release(int n) {
    for (; n > 0; n /= 10)
        used[n%10] = 0;
}

int main() {
    long sum = 0L;
    init();

    for (int Q = 1; Q < 10000; Q++) if (unq(Q)) {
        use(Q);

        int awesome = 0;
        for (int D = 1; D < 10000; D++) if (unq(D) && valid(D)) {
            use(D);
            int N = Q*D;
            if (unq(N) && valid(N)) {
                use(N);
                if (complete()) awesome = 1;
                release(N);
            }
            release(D);

            if (awesome) {
                printf("%d = %d / %d\n", Q,N,D);
                break;
            }
        }
        if (awesome) sum += Q;
        release(Q);
    }

    printf("SUM: %ld\n", sum);
}

Output:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
3 = 17082 / 5694
4 = 15628 / 3907
6 = 34902 / 5817
7 = 21658 / 3094
27 = 16038 / 594
36 = 17820 / 495
39 = 15678 / 402
45 = 17820 / 396
46 = 32890 / 715
52 = 19084 / 367
54 = 16038 / 297
63 = 58401 / 927
78 = 26910 / 345
297 = 16038 / 54
345 = 26910 / 78
367 = 19084 / 52
396 = 17820 / 45
402 = 15678 / 39
495 = 17820 / 36
594 = 16038 / 27
715 = 32890 / 46
927 = 58401 / 63
3094 = 21658 / 7
3907 = 15628 / 4
4093 = 28651 / 7
5694 = 17082 / 3
5817 = 34902 / 6
6819 = 20457 / 3
6918 = 20754 / 3
7039 = 28156 / 4
8169 = 24507 / 3
9127 = 36508 / 4
9168 = 27504 / 3
9304 = 65128 / 7
9403 = 65821 / 7
SUM: 93550

Here's my solution with a sum of 93,591 - guess I didn't know they had to be UNIQUE

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
3 = 17,082 / 5,694
3 = 20,457 / 6,819
3 = 20,754 / 6,918
3 = 24,507 / 8,169
3 = 27,504 / 9,168
4 = 15,628 / 3,907
4 = 28,156 / 7,039
4 = 36,508 / 9,127
6 = 34,902 / 5,817
7 = 21,658 / 3,094
7 = 28,651 / 4,093
7 = 65,128 / 9,304
7 = 65,821 / 9,403
27 = 16,038 / 594
36 = 17,820 / 495
39 = 15,678 / 402
45 = 17,820 / 396
46 = 32,890 / 715
52 = 19,084 / 367
54 = 16,038 / 297
63 = 58,401 / 927
78 = 26,910 / 345
297 = 16,038 / 54
345 = 26,910 / 78
367 = 19,084 / 52
396 = 17,820 / 45
402 = 15,678 / 39
495 = 17,820 / 36
594 = 16,038 / 27
715 = 32,890 / 46
927 = 58,401 / 63
3,094 = 21,658 / 7
3,907 = 15,628 / 4
4,093 = 28,651 / 7
5,694 = 17,082 / 3
5,817 = 34,902 / 6
6,819 = 20,457 / 3
6,918 = 20,754 / 3
7,039 = 28,156 / 4
8,169 = 24,507 / 3
9,127 = 36,508 / 4
9,168 = 27,504 / 3
9,304 = 65,128 / 7
9,403 = 65,821 / 7

Terry Smith - 2 years, 10 months ago

Log in to reply

We were asked the sum of all integers that could be written in "awesome" form. There is no reason to add any number more than once to the sum.

But it is an easy mistake to make; I thought of it on time and included a break; statement in my code.

Arjen Vreugdenhil - 2 years, 10 months ago

Log in to reply

That's a very good point. Asperger's got me again!

Terry Smith - 2 years, 10 months ago

My very first Pyhton code:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
print ('Finding a×b=c where all ten digits are used once and a<b.')

def makeset(s):
    v=set()
    for i in range(0,len(s)):
        v.add(s[i])
    return v

csum=0
cvalues=set()
factorvalues=set()
for a in range(1, 1000): #if a has 3 digits and b 3, then 
    sa=str(a)
    va=makeset(sa)
    if len(va)==len(sa): #same length: no double digits
        # what is an upper bound for b?  
        # if c has 4 digits: => contradiction (a and b together have 6 digits, then their product is at least 5 digits > c.)
        # if c has 5 digits then a and b must have 5 digits together, so a has 2 and b has 3 digits.
        # if c has 6 digits => contradiction (a and b together have 4 digits, their product ab is at most 4 digits <c.)
        # so c can be max 98765, and b can be max 98765 // a
        upperb = 98765 // a
        for b in range(a+1, upperb+1):
            sb=str(b)
            vb=makeset(sb)
            if len(sb)==len(vb) and len(va.intersection(vb))==0:
                c=a*b
                sc=str(c)
                vc=makeset(sc)
                if len(sc)==len(vc) and len(va.intersection(vc))==0 and len(vb.intersection(vc))==0:
                    if len(sa)+len(sb)+len(sc)==10:
                        factorvalues.add(a)
                        factorvalues.add(b)
                        print(a,'×',b,'=',c)
factorsum=0
for factor in factorvalues: factorsum += factor
print ('The sum over different values (a or b) that can be expressed as awesome fractions is', factorsum)

Output:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Finding a×b=c where all ten digits are used once and a<b.
3 × 5694 = 17082
3 × 6819 = 20457
3 × 6918 = 20754
3 × 8169 = 24507
3 × 9168 = 27504
4 × 3907 = 15628
4 × 7039 = 28156
4 × 9127 = 36508
6 × 5817 = 34902
7 × 3094 = 21658
7 × 4093 = 28651
7 × 9304 = 65128
7 × 9403 = 65821
27 × 594 = 16038
36 × 495 = 17820
39 × 402 = 15678
45 × 396 = 17820
46 × 715 = 32890
52 × 367 = 19084
54 × 297 = 16038
63 × 927 = 58401
78 × 345 = 26910
The sum over different values (a or b) that can be expressed as awesome fractions is 93550 

K T - 2 years, 9 months ago
Patrick Corn
Jul 16, 2018
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
s1 = [[x,y] for x in range(1,10) for y in range(1000,10000)
      if ''.join(sorted(str(x)+str(y)+str(x*y))) == '0123456789']

s2 = [[x,y] for x in range(10,100) for y in range(100,1000)
      if ''.join(sorted(str(x)+str(y)+str(x*y))) == '0123456789']

one_digit = set([x[0] for x in s1])
two_digit = set([x[0] for x in s2])
three_digit = set([x[1] for x in s2])
four_digit = set([x[1] for x in s1])

print(sum(one_digit) + sum(two_digit) + sum(three_digit) + sum(four_digit))

Wow, what a beautiful solution! And it takes 0.8s to run compared to 1360s of my 'method'...

Mykyta Shvets - 2 years, 11 months ago

Very nice and elegant!

Pietro Toniolo - 2 years, 10 months ago

That is very slow. Much slower than Pietro Toniolo's solution.

Vadim Shkaberda - 2 years, 10 months ago

Log in to reply

It's takes 0.8s instead of 0.4s, but the code is two times shorter than Pietro Toniolo's. I think it's a fair exchange!

Mykyta Shvets - 2 years, 10 months ago

Log in to reply

Not really :) Code you published contains 477 characters and Pietro's - 424. I know you could use letters instead "one_digit" etc. But that would not make the code significally shorter.

PS. Code I wrote even longer, so don't take it as an accusation of some sort.

Vadim Shkaberda - 2 years, 10 months ago
Shouvik Chaudhury
Jul 18, 2018

Wrote this code in C, because I don't know Python.

The logic is simple, the product of A x B should be a five digit number.
Case 1 : A (can be 3 digit) x B (must be 2 digit) OR
Case 2 : A (can be 4 digit) x B (must be 1 digit)
No other cases are possible where A,B and (AxB) have unique digits from 0 to 9, i.e. 10 unique digits in total.


The code runs all 3 digit x 2 digit and 4 digit x 1 digit multiples, which results in a 5 digit number and then checks whether A, B & AxB have all unique digits
(I call number Lucky, if it has all unique digits!)

The program calculates sum of all such A and B.
The sum (calculated in the code) will have some repetitions, you may eliminate those from the output (manual checking).

#include <stdio.h>

int main()
{
    int sum = 0, rem=0; 

    //possibilities are 3 x 2 digit or 4 x 1 digit
    for (int i=100; i<10000; i++) // 3 to 4 digits
    {
         for (int j=1; j<100; j++) //1 to 2 digits
         {
        rem = (i*j)/10000;
        if(rem>=1) // check if product is 5 digit (rem > = 1)
        {
            //check if i,j & (i*j) have all unique numbers from 0 to 9
            if(isLucky(i,j,(i*j))) 
            {
                sum = sum + i + j;
                printf("Product = %d, D = %d, Q = %d\n\n",i*j,j,i);
            }
        }
    }
}
printf("\nSum = %d",sum);
return 0;
}

int isLucky(int n1, int n2, int n3)
{
      // Create an array of size 10 and initialize all
      // elements as false. This array is used to check
      // if a digit is already seen or not.
      int arr[10];
      for (int i=0; i<10; i++)
            arr[i] = 0;

// Traverse through all digits of given number
while (n1 > 0)
{
    // Find the last digit
    int digit = n1%10;

    // If digit is already seen, return zero
    if (arr[digit]==1)
       return 0;

    // Mark this digit as seen
    arr[digit] = 1;

    // Remove the last digit from number
    n1 = n1/10;
}

while (n2 > 0)
{
    // Find the last digit
    int digit = n2%10;

    // If digit is already seen, return zero
    if (arr[digit]==1)
       return 0;

    // Mark this digit as seen
    arr[digit] = 1;

    // Remove the last digit from number
    n2 = n2/10;
}

while (n3 > 0)
{
    // Find the last digit
    int digit = n3%10;

    // If digit is already seen, return zero
    if (arr[digit]==1)
       return 0;

    // Mark this digit as seen
    arr[digit] = 1;

    // Remove the last digit from number
    n3 = n3/10;
}

return 1;
 }
John Lee
Jul 20, 2018
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
s = set()

def main():
    for i in range(1000):
        for j in range(1, 10 ** (6 - len(str(i)))):
            s1 = str(i) + str(j) + str(i * j)
            if len(s1) == 10 and len(list(set(list(s1)))) == 10:
                s.add(i)
                s.add(j)
    l = list(s)
    print sum(l)

if __name__ == '__main__':
    main()

Result:

1
93550

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import java.util.ArrayList;

public class MagicFraction {
    public static void main(String[] args){
        /*We are certain that the Awesome number does not exceed 6 digits,
         *so it is possible to set the upper bound of both denominator and the awesome number.
         */
        // product = i * j
        for(int i=1; i<100000; i++){
            for(int j=2; j<100000/i; j++){
                //Init ArrayList with numbers 0 to 9
                ArrayList<Integer> digits = new ArrayList<Integer>();
                for(int x=0; x<=9; x++){
                    digits.add(x);
                }
                //Remove elements inside the first number i
                char[] iarr = (i+"").toCharArray();
                for(char num : iarr){
                    digits.remove((Object)Integer.parseInt(""+num));
                }
                //Check if j can be formed from the array or not
                char[] jarr = (j+"").toString().toCharArray();
                for(char num : jarr){
                    if(!digits.contains(""+(num))) break;
                }
                for(char num : jarr){
                    digits.remove((Object)Integer.parseInt(""+num));
                }
                //Find product of i and j and check the digits
                int product = i*j;
                char[] parr = (product+"").toString().toCharArray();
                for(char num : parr){
                    if(!digits.contains(""+(num))) break;
                }
                //Remove digits from product
                for(char num : parr){
                    digits.remove((Object)Integer.parseInt(""+num));
                }
                /*Check if the remaining digit array is empty
                 *and i, j, product has used the numbers only once (dupe digits exists sometimes).
                 *ArrayList.remove() does nothing if the element inside doesn't exist.
                 *This will print all possible ordered pairs (awesome no., denominator)
                 */
                if(digits.isEmpty() && iarr.length+jarr.length+parr.length == 10) {
                    System.out.println(product+"="+i+"*"+j);
                }
            }
        }
    }
}

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
17082=3*5694
20457=3*6819
20754=3*6918
24507=3*8169
27504=3*9168
15628=4*3907
28156=4*7039
36508=4*9127
34902=6*5817
21658=7*3094
28651=7*4093
65128=7*9304
65821=7*9403
16038=27*594
17820=36*495
15678=39*402
17820=45*396
32890=46*715
19084=52*367
16038=54*297
58401=63*927
26910=78*345
16038=297*54
26910=345*78
19084=367*52
17820=396*45
15678=402*39
17820=495*36
16038=594*27
32890=715*46
58401=927*63
21658=3094*7
15628=3907*4
28651=4093*7
17082=5694*3
34902=5817*6
20457=6819*3
20754=6918*3
28156=7039*4
24507=8169*3
36508=9127*4
27504=9168*3
65128=9304*7
65821=9403*7

Friedrich Knauss
Jul 17, 2018

I brute forced it, in a quarter second.

I'm only posting because I wanted to try out the coding environment on the webpage, and it wouldn't let me use a pipe character ("|") in the editor, and I'm not sure where to report bugs.

Yes, I had the same problem, but I could post the code here (see below).

Maurice van Peursem - 2 years, 10 months ago

A brute-force program that takes less than half a minute:

import itertools

TotalSet = set()
for a in range(2, 100):
    b = set(list(str(a)))
    if a > 9 and len(b) == 1:
        continue                        # ignore multiples of 11
    Remain = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'} - b
    Len = len(Remain) // 2
    for Term in itertools.permutations(Remain):
        for i in range(Len):
            Nb1Str = ''.join(Term[:i + 1])
            Nb2Str = ''.join(Term[i + 1:])
            if(Nb1Str[0] != '0' and Nb2Str[0] != '0'):
                Nb1 = int(Nb1Str)
                Nb2 = int(Nb2Str)
                if(a * Nb1 == Nb2):
                    print('Success!', a, '*', Nb1, '=', Nb2)
                    TotalSet |= {a, Nb1}
                    break
print('Total set:', sorted(TotalSet))
Total = sum(TotalSet)
print('Total:', Total)

Hi,

I obtained 44 'awesome fractions' instead of 35. As you can see, there are more than one fraction for 3,4,7... I don't know if I am wrong, but I would like to know if I am.

3 = 17082 / 5694

3 = 20457 / 6819

3 = 20754 / 6918

3 = 24507 / 8169

3 = 27504 / 9168

4 = 15628 / 3907

4 = 28156 / 7039

4 = 36508 / 9127

6 = 34902 / 5817

7 = 21658 / 3094

7 = 28651 / 4093

7 = 65128 / 9304

7 = 65821 / 9403

27 = 16038 / 594

36 = 17820 / 495

39 = 15678 / 402

45 = 17820 / 396

46 = 32890 / 715

52 = 19084 / 367

54 = 16038 / 297

63 = 58401 / 927

78 = 26910 / 345

297 = 16038 / 54

345 = 26910 / 78

367 = 19084 / 52

396 = 17820 / 45

402 = 15678 / 39

495 = 17820 / 36

594 = 16038 / 27

715 = 32890 / 46

927 = 58401 / 63

3094 = 21658 / 7

3907 = 15628 / 4

4093 = 28651 / 7

5694 = 17082 / 3

5817 = 34902 / 6

6819 = 20457 / 3

6918 = 20754 / 3

7039 = 28156 / 4

8169 = 24507 / 3

9127 = 36508 / 4

9168 = 27504 / 3

9304 = 65128 / 7

9403 = 65821 / 7

Answer: 93591

Jhovanny Hernández - 2 years, 10 months ago

Log in to reply

The question is: "What is the sum of all integers that can be expressed as awesome fractions?", you may count the 3's, 4's and 7's only once!

Maurice van Peursem - 2 years, 10 months ago
Jeremy Galvagni
Jul 22, 2018

Not being a programmer, I found a few solutions then cheated: https://oeis.org/A195814 is a list that could be 'awesome products'

After factoring them I found the sum of the factors. It still took me two tries because I didn't realize at first that two of them factor in two ways.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...