Maths Olympiad Prep

Library / /168 of 168

Algebra Difficulty 3.7 AMC 10/12 Find the answer

P.J. starts with m=500m=500 and chooses a positive integer nn with 1n4991 \leq n \leq 499. He applies the following algorithm to mm and nn: P.J. sets rr equal to the remainder when mm is divided by nn. If r=0r=0, P.J. sets s=0s=0. If r>0r>0, P.J. sets ss equal to the remainder when nn is divided by rr. If s=0s=0, P.J. sets t=0t=0. If s>0s>0, P.J. sets tt equal to the remainder when rr is divided by ss. For how many of the positive integers nn with 1n4991 \leq n \leq 499 does P.J.'s algorithm give 1r151 \leq r \leq 15 and 2s92 \leq s \leq 9 and t=0t=0?

A number or a short expression. Spacing and $ signs are ignored.

Solution

Suppose that m=500m=500 and 1n4991 \leq n \leq 499 and 1r151 \leq r \leq 15 and 2s92 \leq s \leq 9 and t=0t=0. Since s>0s>0, then the algorithm says that tt is the remainder when rr is divided by ss. Since t=0t=0, then rr is a multiple of ss. Thus, r=asr=a s for some positive integer aa. Since r>0r>0, then the algorithm says that ss is the remainder when nn is divided by rr. In other words, n=br+sn=b r+s for some positive integer bb. But r=asr=a s, so n=bas+s=(ba+1)sn=b a s+s=(b a+1) s. In other words, nn is a multiple of ss, say n=csn=c s for some positive integer cc. Since n>0n>0, then rr is the remainder when mm is divided by nn. In other words, m=dn+rm=d n+r for some positive integer dd. But r=asr=a s and n=csn=c s so m=dcs+as=(dc+a)sm=d c s+a s=(d c+a) s. In other words, mm is a multiple of ss, say m=esm=e s for some positive integer ee. But m=500m=500 and 2s92 \leq s \leq 9. Since mm is a multiple of ss, then ss is a divisor of 500 and so the possible values of ss are s=2,4,5s=2,4,5. (None of 1,3,6,7,8,91,3,6,7,8,9 is a divisor of 500.) We know that rr is a multiple of ss, that r>sr>s (because ss is the remainder when nn is divided by rr ), and that 1r151 \leq r \leq 15. If s=5s=5, then r=10r=10 or r=15r=15. If s=4s=4, then r=8r=8 or r=12r=12. If s=2s=2, then r=4,6,8,10,12,14r=4,6,8,10,12,14. Suppose that s=5s=5 and r=10r=10. Since m=dn+rm=d n+r, then 500=dn+10500=d n+10 and so dn=490d n=490. Therefore, nn is a divisor of 490, is a multiple of 5 (because n=csn=c s ), must be greater than r=10r=10, and must be 5 more than a multiple of 10 (because the remainder when nn is divided by rr is ss ). Since 490=5×2×72490=5 \times 2 \times 7^{2}, then the divisors of 490 that are multiples of 5 are 5,10,35,70,245,4905,10,35,70,245,490 (these are 5 times the divisors of 2×722 \times 7^{2} ). Among these, those greater than r=10r=10 having remainder 5 when divided by 10 are 35 and 245, and so the possible values of nn in this case are 35 and 245. For each possible pair ss and rr, we determine the values of nn that satisfy the following conditions: - nn is a divsior of 500r500-r, - nn is a multiple of ss, - nn is greater than rr, and - the remainder when nn is divided by rr is ss. Therefore, the possible values of nn are 35,245,485,12,164,492,244,62,26,38,494,82,12235,245,485,12,164,492,244,62,26,38,494,82,122, of which there are 13.

Want a route through all this instead of an archive? The track puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.

Source: Omni-MATH, licensed Apache-2.0. Statement and solution reproduced as published; topic and difficulty added by this site.