Given a positive integer n , let p ( n ) be the product of the non-zero digits of n . (If n has one digit, then p ( n ) is equal to that digit.) Let
S = p ( 1 ) + p ( 2 ) + ⋯ + p ( 9 9 9 ) .
What is the largest prime factor of S ?
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.
Its a question of AIME 1994
Log in to reply
Exactly, I was wondering why this problem seemed so familiar. It would be nice, though, if everyone could post some new original problems.
Log in to reply
I think posting problems from some mathematics competition is great for others who doesn't take part on that competition especially those that is not available for downloads.
Sometimes it's hard to think of new problems when you're so busy. Sorry for any inconvenience.
Please provide some insight for the process that gets you from step 1 to step 2, the sum of products to the cube of a sum.
My biggest question is how would you factor out a number like 46^3 - 1. I used the difference of cubes but didn't get any further..
Log in to reply
You can explicitly evaluate 4 6 2 + 4 6 + 1 = 2 1 6 3 = 7 × 3 0 9 = 7 × 3 × 1 0 3 .
Lets rewrite the first 9 9 and then we will multiply that by 1 , then by 2 , … , then by 9 . Lets say that
S 1 = [ ( 1 + 2 + … + 9 ) + 1 + 1 ( 1 + 2 + … + 9 ) + 2 + 2 ( 1 + 2 + … + 9 ) + … + 9 + 9 ( 1 + 2 + … + 9 ) ]
This is equivalent to
S 1 = 1 ( 4 5 ) + 1 ( 4 6 ) + 2 ( 4 6 ) + … + 9 ( 4 6 )
S 1 = 4 5 ( 4 7 )
S 1 is the sum from 1 to 9 9 . We'll have extra numbers in our sum ( 1 0 0 , 2 0 0 , \ldots, 9 0 0 ), and hence when we multiply 4 5 ⋅ 4 7 by the hundreds digit of the numbers, we need to add 1 . So, it's the same than multiplying 4 6 ⋅ 4 6 which is equal to 4 5 ⋅ 4 7 + 1 . So,
S = S 1 + ( S 1 + 1 ) + 2 ( S 1 + 1 ) + … + 9 ( S 1 + 1 )
S = 2 1 1 5 + 4 5 ( 2 1 1 6 )
We can factorize carefully in many ways, but i like this one:
S = 2 1 1 5 ( 4 6 ) + 4 5 = 9 ( 2 3 5 ⋅ 4 6 + 5 )
S = 3 3 ⋅ 5 ⋅ 7 ⋅ 1 0 3
And therefore, the largest prime factor is:
1 0 3 .
i solved same way..
Me too, same method:)
When 0 digits are equal to 0 , we sum through ∑ a = 1 9 ∑ b = 1 9 ∑ c = 1 9 a b c = 4 5 3 . When 1 digit is equal to 0 , we sum through ∑ a = 1 9 ∑ b = 1 9 a b = 4 5 2 , but there are three cases, accounting for 3 ⋅ 4 5 2 . When there are 2 digits, it's 3 ⋅ 4 5 . All 3 cannot be 0 . Hence, the sum is 4 5 3 + 3 ⋅ 4 5 2 + 3 ⋅ 4 5 = 4 6 3 − 1 which has the largest prime factor of 1 0 3 .
The simplest solution.
Let k ∈ N , and N k : = { 1 0 k − 1 ; … ; 1 0 k − 1 } be the set of positive integers with exactly k digits. Define
S k : = i = 1 ∑ 1 0 k − 1 p ( i ) , S 1 = i = 1 ∑ 9 i = 2 9 ⋅ 1 0 = 4 5 ∣ We need to compute S 3
Check for a recursive relation. Notice any integer in N k + 1 consists of a non-zero first digit , followed either by an integer in N k , or 0 : S k + 1 = S k + i ∈ N k + 1 ∑ p ( i ) = S k + ( 1 + … + 9 ) ⋅ ( S k + 1 ) = S k + 4 5 ( S k + 1 ) = 4 6 S k + 4 5
By induction, we get S k = 4 6 k − 1 , S 3 = 4 6 3 − 1 = 9 7 3 3 5 = 3 3 ⋅ 5 ⋅ 7 ⋅ 1 0 3
Let x,y,z be nonzero digits.
∑ x = 1 9 ∑ y = 1 9 ∑ z = 1 9 p ( x y z ) = 4 5 3
∑ x = 1 9 ∑ y = 1 9 p ( x y 0 ) = ∑ x = 1 9 ∑ z = 1 9 p ( x 0 z ) = ∑ y = 1 9 ∑ z = 1 9 p ( y z ) = 4 5 2
∑ x = 1 9 p ( x 0 0 ) = ∑ y = 1 9 p ( y 0 ) = ∑ z = 1 9 p ( z ) = 4 5
4 5 3 + 3 × 4 5 2 + 3 × 4 5 = 4 5 ( 4 5 2 + 3 × 4 6 ) = 4 5 × 2 1 6 3 = 3 3 × 5 × 7 × 1 0 3
This is quite a brute force ansatz with code for matlab. The final sum will be 97335 which can be found to have 103 as it's largest primefactor.
The variables stand for the german words for
h = Hunderter = hundreds
z = Zehner = tens
e = Einser = ones
finalsum = 0;
tempsum = 0;
for h = 0:9
for z = 0:9
for e = 0:9
if h == 0
if z == 0
tempsum = e;
elseif z > 0
if e == 0
tempsum = z;
elseif e > 0
tempsum = z*e;
end
end
elseif h > 0
if z == 0
if e == 0
tempsum = h;
elseif e > 0
tempsum = h*e;
end
elseif z > 0
if e == 0
tempsum = h*z;
elseif e > 0
tempsum = h*z*e;
end
end
end
finalsum = finalsum + tempsum;
end
end
end
finalsum
Good as far as it goes, but just for completeness here's a python function to return the highest prime factor. It just keeps dividing by prime factors until the result is a prime. Apologies for the name; I may be writing this later at night than I should be.
def maxfactor(n):
i = 2
while i!= n:
if n%i == 0:
n = n//i
else:
i = i+1
return i
Apologies...but gentleman this code is not returning correct value
Log in to reply
I think this code works
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
Problem Loading...
Note Loading...
Set Loading...
Consider each positive integer less than 1000 to be a three-digit number by prefixing 0s to numbers with fewer than 3 digits. The sum of the products of the digits of all such positive numbers is
( 0 ⋅ 0 ⋅ 0 + 0 ⋅ 0 ⋅ 1 + . . . + 9 ⋅ 9 ⋅ 9 ) − 0 ⋅ 0 ⋅ 0
Note that each product appears once, thrice or 6 times depending on the number of repeated digits it has, so we get that the product is = ( 0 + 1 + . . . + 9 ) 3 − 0 .
However, p ( n ) is the product of non-zero digits of n . The sum of these products can be found by replacing 0 by 1 in the above expression, since ignoring 0's is equivalent to thinking of them as 1's in the products. (Note that the final 0 in the above expression becomes a 1 and compensates for the contribution of 000 after it is changed to 111.) Hence
S = 4 6 3 − 1 = ( 4 6 − 1 ) ( 4 6 2 + 4 6 + 1 ) = 3 3 ⋅ 5 ⋅ 7 ⋅ 1 0 3
and the largest prime factor is 103.