factorisation problem

factorise 57284861 . [ use whatever you want ] Considering x 1 , x 2 x n x_1,x_2 \cdots x_n to be the prime factors, calculate ( x 1 1 ) ( x 2 1 ) ( x n 1 ) (x_1-1)(x_2-1)\cdots(x_n-1)


The answer is 57269724.

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

Brock Brown
Jan 4, 2015
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
factors = set()
number = 57284861
i = 2
while i <= number:
    while number % i == 0:
        number = number / i
        factors.add(i)
    i += 1
product = 1
for factor in factors:
    product *= (factor - 1)
print "Answer:", product

Is there a way to optimize the program? E.g.: Search for all primes that are less than 57284861 \sqrt{57284861} ?

Pi Han Goh - 5 years, 8 months ago

Hi Saptarshi;

How are you? Do you like carrots?

I used Wolfram Mathematica to solve this:

FactorInteger[57284861]

i use microsoft mathematics

math man - 6 years, 8 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...