Skip to content

Latest commit

 

History

History

number_theory

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Number Theory

Square root of a prime number without using built in sqrt function


In number theory, a perfect number is a positive integer that is equal to the sum of its proper positive divisors, that is, the sum of its positive divisors excluding the number itself. e.g 28 is a perfect number divisors of 28 are 1,2,4,7,14 which sum upto 28 = (1+2+4,7+14)

Armstrong number:

An Armstrong number is a number such that the sum  of its digits raised to the third power is equal to the number itself.
For example, 371 is an Armstrong number, since 3^3+7^3+1^3 = 371

1. Given input n print first n elements of the Series of the form 2,6,6,12,12,12,20,20,20,20,30,30,30,30,30....

In mathematics, the factorial of a non-negative integer n, denoted by n!, is the product of all positive integers less than or equal    to n. For example, The value of 0! is 1, according to the convention for an empty product.
e.g 5! = 120 i.e 5x4x3x2x1=120

Printing alternate prime numbers

prime: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41...
Alternate Prime: 2, 5, 11, 17, 23, 31, 41...
In mathematics, the Fibonacci numbers, commonly denoted Fₙ, form a sequence, called the Fibonacci sequence, such that each number is the sum of the two preceding ones, starting from 0 and 1. That is, and for n > 1.
The greatest common divisor (GCD) of two nonzero integers a and b is the greatest positive integer d such that d is a divisor of both a and b; that is, there are integers e and f such that a = de and b = df, and d is the largest such integer. The GCD of a and b is generally denoted gcd(a, b).
HCF of two numbers is the highest common number, which is available in both the numbers. ... Sometimes, it is also called the greatest common factor (GCF) or greatest common divisor (GCD). For example, the HCF of 2 and 4 is 2, because 2 is the number which is common to both 2 and 4.

Matrix Multiplication

Matrix Inverse

## Printing camel case ## [Between Two Sets](https://www.hackerrank.com/challenges/between-two-sets/problem)
There will be two arrays of integers. Determine all integers that satisfy the following two conditions:

- The elements of the first array are all factors of the integer being considered
- The integer being considered is a factor of all elements of the second array
These numbers are referred to as being between the two arrays. Determine how many such numbers exist.

Example

input:
a=[2,4]
b=[16,32,96]

output: 3
swap the input variables
input: a=10,b=20
output:a=20,b=10
In mathematics, particularly in linear algebra, matrix multiplication is a binary operation that produces a matrix from two matrices. For matrix multiplication, the number of columns in the first matrix must be equal to the number of rows in the second matrix. The resulting matrix, known as the matrix product, has the number of rows of the first and the number of columns of the second matrix. The product of matrices A and B is denoted as AB