Skip to main content

Important Formulas of Number System

Formulas of Number Series
  1. 1 + 2 + 3 + 4 + 5 + … + n                      =    n(n + 1)/2
  2. (12 + 22 + 32 + ..... + n2)                        =    n ( n + 1 ) (2n + 1) / 6
  3. (13 + 23 + 33 + ..... + n3)                        =    (n(n + 1)/ 2)2
  4. Sum of first n odd numbers                   =    n2
  5. Sum of first n even numbers                 =    n (n + 1)

Mathematical Formulas
  1. (a + b)(a - b)                        =             (a2 - b2)
  2. (a + b)2                                          =             (a2 + b2 + 2ab)
  3. (a - b)2                                           =              (a2 + b2 - 2ab)
  4. (a + b + c)2                                 =               a2 + b2 + c2 + 2(ab + bc + ca)
  5. (a3 + b3)                              =              (a + b)(a2 - ab + b2)
  6. (a3 - b3)                               =              (a - b)(a2 + ab + b2)
  7. (a3 + b3 + c3 - 3abc)          =              (a + b + c)(a2 + b2 + c2 - ab - bc - ac)
  8. When a + b + c = 0, then a3 + b3 + c3         =         3abc
  9. (a + b)n                               =        an + (nC1)an-1b + (nC2)an-2b2 + … + (nCn-1)abn-1 + bn

Shortcuts for number divisibility check
  1. A number is divisible by 2, if its unit's digit is any of 0, 2, 4, 6, 8.
  2. A number is divisible by 3, if the sum of its digits is divisible by 3.
  3. A number is divisible by 4, if the number formed by the last two digits is divisible by 4.
  4. A number is divisible by 5, if its unit's digit is either 0 or 5.
  5. A number is divisible by 6, if it is divisible by both 2 and 3.
  6. A number is divisible by 8, if the number formed by the last three digits of the given number is divisible by 8.
  7. A number is divisible by 9, if the sum of its digits is divisible by 9.
  8. A number is divisible by 10, if it ends with 0.
  9. A number is divisible by 11, if the difference of the sum of its digits at odd places and the sum of its digits at even places, is either 0 or a number divisible by 11.
  10. A number is divisible by 12, if it is divisible by both 4 and 3.
  11. A number is divisible by 14, if it is divisible by 2 as well as 7.
  12. Two numbers are said to be co-primes if their H.C.F. is 1. To find if a number, say y is divisible by x, find m and n such that m * n = x and m and n are co-prime numbers. If y is divisible by both m and n then it is divisible by x.

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