Skip to main content

Finding remainder on dividing numbers

Finding remainder on dividing numbers

Here is a nifty way to find remainder on diving numbers:

Remainder on dividing by 3

To find the remainder of a number divided by 3, add the digits of the number and divide it by 3. So if the digits added together equal 8 then the number has a remainder of 2 since 8 divided by 3 has a remainder of 2.

For example, find the remainder on dividing 1,342,568 by 3.
The digit sum of 1342568 is 1+3+4+2+5+6+8 = 29.
Again, the digit sum of 29 = 2+9 = 11 = 2
So, the remainder will be 2.

Another example: Take 34,259,677,858.
The digit sum of the number is 3+4+2+5+9+6+7+7+8+5+8 = 64.
Now, the digit sum of 64 is 6+4 = 10 = 1.
So, the remainder is 1.

Similarly, the digit sum of 54,670,329,845 is 53 i.e. (5+3=) 8.
When we divide 8 by 3, we get remainder 2.
So the answer will be 2.

Remainder on dividing by 4

To find the remainder of a number divided by 4, take the remainder of the last 2 digits.  So if the last 2-digits are 13 then the number has a remainder of 1 since 13 divided by 4 has a remainder of 1.

Remainder on dividing by 5

To find the remainder of a number divided by 5, simply use the last digit.  If it is greater than 5, subtract 5 for the remainder.

Remainder on dividing by 7

Split the digits of the number in group of 3 starting from unit’s place. Add the alternate group and then find their difference. Divide the difference by 7 and get the remainder.
Consider the number 34568276.

Make triplets as written below starting from unit’s place
34.........568..........276
Now alternate sum = 34+276=310 and 568 and difference of these sums =568-310=258. Divide it by 7 we get remainder as 6.
Another example, consider the number 4523895099854
Triplets pairs are 4…523…895…099…854
Alternate sums are 4+895+854=1753 and 523+099=622
Difference =1131
Revise the same tripling process 1…131
So difference = 131-1=130

Divide it by 7 we get remainder as 4.

Remainder on dividing by 8

To find the remainder of a number divided by 8, take the remainder of the last 3-digits.  So if the last 3-digits are 013 then the number has a remainder of 5 since 13 divided by 8 has a remainder of 5.

Remainder on dividing by 9

To find the remainder of a number divided by 9, add the digits and then divide it by 9. So if the digits added together equal 13 then the number has a remainder of 4 since 13 divided by 9 has a remainder of 4.

Remainder on dividing by 10

To find the remainder of a number divided by 10 simply use the last digit.

Remainder on dividing by 11

The difference of the sums of the alternate digits is the remainder after dividing by 11 if it is positive.  If the number is negative add 11 to it to get the remainder.

Take the number 34568276 for example.

Sum of alternate digits are 3+5+8+8=24 and 4+6+2+6=18

And difference of these sums =24-18=6.
So, the remainder is 6.

Remainder on dividing by 13

Split the digits of the number in group of 3 starting from unit’s place. Add the alternate group and then find their difference. Divide the difference by 13 and get the remainder.
Consider the number 34568276.
Finding-remainder-on-dividing-numbers
Split the number as 34.........568..........276

Now alternate sum = 34+276=310 and 568
and difference of these sums =568-310=258

Divide it by 13 we get remainder as 11

Another example, consider the number 4523895099854
Triplets pairs are 4…523…895…099…854
Alternate sums are 4+895+854=1753 and 523+099=622
Difference =1131
Revise the same tripling process 1…131
So difference = 131-1=130

Divide it by 13 we get remainder as 0

Remainder on dividing by 27 and 37

Consider the number 34568276; we have to calculate the reminder on dividing the number by 27 and 37.

Make triplets as written below starting from unit’s place
34.........568..........276
Now sum of all triplets = 34+568+276 = 878

Dividing it by 27 we get reminder as 14
Dividing it by 37 we get reminder as 27

Another example for the clarification of the rule; take the number 2387850765.
Triplets are 2…387…850…765
sum of the triplets = 2+387+850+765=2004.
On revising the steps we get 2…004
Sum =6

Dividing it by 27 we get remainder as 6.
Dividing it by 37 we get remainder as 6.

Comments

Popular posts from this blog

ORACLE 9i practice solutions

Created by BCL easyConverter SDK 3 (HTML Version)

Zoho Puzzle Questions With Answers

Measuring Time Logic Puzzle You are given with two ropes with variable width. However if we start burning both the ropes, they will burn at exactly same time i.e. an hour. The ropes are non-homogeneous in nature. You are asked to measure 45 minutes by using these two ropes.

How can you do it?

Please note that you can’t break the rope in half as it is being clearly stated that the ropes are non-homogeneous in nature.
Answer & Explanation Solution: 45 minutes

Explanation :
All you have to do is burn the first rope from both the ends and the second rope from one end only simultaneously. The first rope will burn in 30 minutes (half of an hour since we burned from both sides) while the other rope would have burnt half. At this moment, light the second rope from the other end as well. Where, the second rope would have taken half an hour more to burn completely, it will take just 15 minutes as we have lit it from the other end too.

Thus you have successfully calculated 30+15 = 45 minutes …

Hackerrank > SQL > Basic Select

Select
01-Select All
Given a City table, whose fields are described as +-------------+----------+ | Field       | Type     | +-------------+----------+ | ID          | int(11)  | | Name        | char(35) | | CountryCode | char(3)  | | District    | char(20) | | Population  | int(11)  | +-------------+----------+
write a query that will fetch all columns for every row in the table.

My Solution
SELECT*FROM city;
---------------------------------------------------------------------------------
02-Select by ID
Given a City table, whose fields are described as