find a positive integer that ends in 17, is divisible by 17 and the sum of its digits is equal to 17.?

2009-06-04 2:07 pm
find a positive integer that ends in 17, is divisible by 17 and the sum of its digits is equal to 17.
please show the steps

回答 (4)

2009-06-04 2:16 pm
✔ 最佳答案
well, i assumed that it would look like

xx17
which would mean that xx00 would have to be divisible by 17
1717 adds to 16
3417 adds to 15
5117 adds to 14
6817 adds to 22
8517 adds to 21

so it can't look like xx17- lets try xxx17
10217 (8517 + 1700) adds to 11
11917 adds to 19
13617 adds to 18
15317 adds to 17

therefore one of the possible integers is 15317

u could also have things like 1530017
2009-06-04 9:21 pm
Since the sum of the digits is 17 and 1 + 7 = 8, the sum of all the digits before the last two digits is 17 - 8 = 9. So we are looking for a number of the form ab...yz17, where a + b + ... + y + z = 9.

Also, since ab...yz17 is divisible by 17, that means ab..yz00 must be divisible by 17 also, since it is exactly 17 less. This in turn means that ab..yz must be divisible by 17. So we have reduced it to looking for a number that is divisible by 17 and that has digits summing to 9.

Looking through the first several multiples of 17 we come across 153. This is a multiple of 17 (17 * 9), and it's digits sum to 9 (1 + 5 + 3 = 9).

So a number that works is 15317. It ends in 17 (check), it is divisible by 17 (15317/17 = 901, check), and the sum of its digits is equal to 17 (1+5+3+1+7 = 17, check).
2009-06-04 9:17 pm
The number (in base 10, I presume) will look like this:

cba17
Also, the first 10 multiples of 17 are {17, 34, 51, 68, 85, 102, 119, 136, 153, 170}
The only multiple that ends with '17' is the first one.

Therefore, the last number in the quotient will be 1. This means that the last two digits must stand by themselves when you have divided the cba part.
In other words, cba itself must be a multiple of 17.

The digits add up to 17. The digits '1' and '7' add up to 8. This leaves nine as the sum of c+b+a

Go through the list of multiples: 153 fits the bill.

check

15317
ends in '17'
is divisible by 17 (we built it that way)
digits add up to 17 (we built it that way).
2009-06-06 6:03 am
Solution: 15317

#!/usr/bin/perl -w
use strict;

my $num = 17;

while( 1 )
{
if( $num % 100 == 17 )
{
my $sum = 0;
grep( $sum += $_, split(//,$num) );
if( $sum == 17 )
{
print "Solution: $num\n";
exit(0);
}
}
$num += 17;
}


收錄日期: 2021-05-01 12:27:21
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20090604060701AARfMNk

檢視 Wayback Machine 備份