How many 6 -digit palindromes are divisible by 8 ?
This problem is posed by Kiriti M .
Details and assumptions
The number 1 2 = 0 1 2 is a 2-digit number, not a 3-digit number.
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.
Clear and simple!
Good One..
A number is divisible by 8 if its 3 last digits are divisible by 8.
There are 124 multiples of 8 with 3 digits (i.e floor(999/8) = 124). Since it is a palindrome, and given the property above, we just need to know these 3 digits, and the other 3 digits of the palindrome are determined.
The 3 digit-number must not end in 0, however, because then the 6-digit palindrome would not be a 6-digit number at all =). The multiples of 8 that end in 0 are only those that are also multiples of 5. Among the 124 multiples of 8 with 3 digits, there are floor(124/5) = 24, which are also multiples of 5. Hence our final answer is 124 - 24 = 100.
You should be careful with the second paragraph, and justify the ⌊ 5 1 2 4 ⌋ calculation properly.
A better way of expressing it is that c b 0 is a multiple of 8 if and only if c b is a multiple of 4, and apply the argument in the first paragraph.
Log in to reply
Correct - do you have any idea when it will be possible to edit solutions? Is this a feature that you Brilliant is planning to implement?
that is the best solution ever! NICE!
A 6 -digit palindrome is formed like this: a b c c b a .
Let's rewrite the number a bit...
a b c c b a = a b c 0 0 0 + c b a = ( a b c × 1 0 0 0 ) + c b a
Since, 8 divides 1 0 0 0 , ( a b c × 1 0 0 0 ) is clearly divisible by 8 . Now, all we have to make sure is 8 divides c b a . Hence, we need to find out the number of all positive integer multiples of 8 which are at most 3 -digit.
There are total 1 2 5 such positive integers which are... 0 0 8 , 0 1 6 , 0 2 4 , . . . , 9 8 4 , 9 9 2 , 0 0 0 .
Notice that, in the number c b a , if a = 0 , then the palindrome would be 0 b c c b 0 which is not at all a 6 -digit number. So, we have to put away all such numbers which have 0 as the last digit. This happens only when 8 is multiplied by the multiples of 5 .
We found 1 2 5 outcomes, and there are ( 1 2 5 ÷ 5 ) = 2 5 numbers which are found by multiplying 8 by multiples of 5 .
Therefore, the required answer is ( 1 2 5 − 2 5 ) = 1 0 0 .
Note: c b a i.e. the multiples of 8 should be non-negative, not necessarily positive.
A number is divisible by 8 if the last three digits are divisible by 8 .
A 6 -digit palindrome is fixed once the last three digits are chosen.
There are 1 2 5 multiples of 8 below 1 0 0 0 :
0 ∗ 8 , 1 ∗ 8 , ..., 1 2 4 ∗ 8 .
There are 2 5 multiples of 8 below 1 0 0 0 that end in one or more zeroes. These would give palindromes of less than 6 digits:
0 ∗ 4 0 , 1 ∗ 4 0 , ..., 2 4 ∗ 4 0 .
Therefore, there are 1 2 5 − 2 5 = 1 0 0 6 -digit palindromes divisible by 8.
The divisibility rule for 8 is that if the last three digits are divisible by 8, the whole number is divisible. Remember, when you solve palindromes, you should just know that you only focus on one side, because it will just be mirrored again. So all that this is really asking is how many multiples of 8 are there less than 1,000 that do not have a zero at the end (otherwise when you flipped in over, it would make a 5 digit number). Obviously there are 24 of these types of numbers, anything divisible by 40. Then we know that there are 124 multiples of 8. Subtracting 24 from 124 gives the answer 100.
Let the 6 -digit palindrome be written as a b c c b a . Then: 8 ∣ c b a because for a number to be divisible by 8 , the last 3 digits must also be divisible by 8 .
The total number of numbers c b a , such that 8 ∣ c b a , c b a ∈ [ 0 , 1 0 0 0 ) is given by 8 1 0 0 0 = 1 2 5 . However, we also know that a > 0 for a b c c b a to be a 6 -digit number. Now consider the possible values of c b a . These are: 0 0 0 , 0 0 8 , 0 1 6 , 0 2 4 , 0 3 2 , 0 4 0 … Notice that everyone one in five possible values of c b a is invalid, because a = 0 . Therefore, the final answer is 1 2 5 ⋅ 5 4 = 1 0 0
To find out if a number that is larger than 3 digits divisible, simply look at the last three digits and find out if they form a number divisible by 8.
Since it is a palindrome, you're only working with 3 digits technically.
There are 124 numbers in 3 digits which are divisible by 8 (1000/8=125-1 because 1000 does not count). However, as the question stated 6 digits, you must omit multiples with "0" at the end because it results in a zero at the beginning of the palindrome, making a five digit number instead of six.
Multiples of 8 with a "0" at the end are multiples of 40. There are 25 multiples of 40 in three digits (1000/40-1 = 24).
You have to remove those multiples of 40, so 124-24 = 100.
Therefore there are 100 "6-digit palindromes" that are divisible by 8.
Let the 6 digit palindromic number is abccba a≠0 , Because then the number will become a five digit number
Now let's come to the point of divisibility by 8.
When the last three digit of a number is evenly divisible by 8 then the whole number is divisible by 8.
So here if 8 divides cba then it will also divide abccba.
cba can be any number from 001 to 999 if a≠0.
So cba can't be a number which ends with 0 .
Now for knowing how many numbers from 1 to 999 is divisible by 8 we will divide 999 by 8 and take the quotient.We get 124 as quotient by dividing 999 by 8.
But as the 6 digit palindromic numbers can't end with a zero we can't take the numbers which ends with a zero.
The numbers which end with a zero can be divided by 5. Again a number which can be divided by both 5 and 8 can also be divided by 40.
From 1 to 999 there are 24 numbers which can be divided by 40.(by dividing 999 by 40 and taking the quotient.)
So there are 124−24
100 six digit palindromic numbers which can be divided by 8.
I don't really know how to solve this mathematically so I made this code in python.
"""
How many 6-digit palindromes are divisible by 8?
"""
palCount = 0
kiriti = 0
for i in range(100000,1000000): #start with the first 6 digit integer
buffStr=str(i)
#check if it's a palindrome
if buffStr[0]==buffStr[-1] and buffStr[1]==buffStr[-2] and buffStr[2]==buffStr[-3]:
#check if it's divisible by 8
if i%8==0:
kiriti+=1
print kiriti
As the divisibility of eight is of the last three digit of a number, we should find the amount of numbers starting from 008, 016,024,.....to 992,996. Then, deduct the amount of numbers which have 0 behind, i.e 040, 080 because when we flips it into a six digit palindrome, it will become something like 040040, which is invalid. Calculate it and we will find that the answer is 100
By divisibility rules, for a number to be divisible by 8, its last 3 digits will be divisible by 8.
As this is a 6-digit palindrome, the number of multiples of 8 from 1 to 999 should be the answer. From calculation, we find that there are 124 multiples of 8 from 1 to 999 inclusive. (1 8 to 124 8)
HOWEVER, 124 is NOT the answer. This is because the multiples of 8 also include numbers ending with 0. Any 3 digit number ending with zero will result the palindrome to be 5 digit, not 6 digit. Therefore we must eliminate the multiples of 8 that are also multiples of 10. From 1 to 124, there are 1 2 0 ÷ 5 = 2 4 multiples of 5 that would result in a multiple of 8 that are also multiples of 10.
Therefore, our final answer is * 124-24 = 100 *
Since a palindrome is divisible by 8 if the last 3 digits are divisible by 3, you will have 1000/8=125 as your answer. However you will take away 25 since if the last digit ends in a 0, it won't work. So you will take away X40 where there are 10 values for x and X80 with the same 10 for Y. Then take away all that end in X00, and there are 5. That leaves us with 100, which is our answer.
Let the 6 digit palindromic number is a b c c b a
a = 0 , Because then the number will become a five digit number
Now let's come to the point of divisibility by 8.
When the last three digit of a number is evenly divisible by 8 then the whole number is divisible by 8.
So here if 8 divides c b a then it will also divide a b c c b a .
c b a can be any number from 001 to 999 if a = 0 .
So c b a can't be a number which ends with 0 .
Now for knowing how many numbers from 1 to 999 is divisible by 8 we will divide 999 by 8 and take the quotient.We get 124 as quotient by dividing 999 by 8.
But as the 6 digit palindromic numbers can't end with a zero we can't take the numbers which ends with a zero.
The numbers which end with a zero can be divided by 5. Again a number which can be divided by both 5 and 8 can also be divided by 40.
From 1 to 999 there are 24 numbers which can be divided by 40.(by dividing 999 by 40 and taking the quotient.)
So there are 1 2 4 − 2 4 or 100 six digit palindromic numbers which can be divided by 8.
A number is divisible by 8 if its last three digits are. We need to count all three-digit multiples of 8 that don't end in 0 (so it's a 6-digit palindrome). Consider 1000=8*125. Since 1/5 of the first 125 multiples end in 0, we have 4/5 (125)=100 remaining satisfactory numbers. Note this also excludes 1000, which we didn't want in the first place.
The 6 digit palindrome can be written as a b c 1 0 0 0 + c b a . Since 1 0 0 0 m o d 8 ≡ 0 , any c b a that is divisible by 8 with result in a b c c b a also being divisible by 8. The only restriction on c b a is that a cannot be 0. The total number of c b a that are divisible by 8 are 124. Every 5th of these ends with a zero and should be rejected. There are a total of 24 zero numbers off 124 that should be rejected. There are a total of 124-24 = 100 number that remain that are valid palindromes that are divisible by 8.
Problem Loading...
Note Loading...
Set Loading...
Number of 6 -digit palindromes divisible by 8 is given by
Number of 3 -digit numbers divisible by 8 − Number of 3 -digit numbers divisible by both 8 and 5 (i.e 4 0 )
∴ 1 2 4 − 2 4 = 1 0 0
Thus, there are 1 0 0 , 6 -digit palindromes divisible by 8