Eva Sharma has Published 18 Articles

Sort on the basis of number of factors using STL

Eva Sharma

Eva Sharma

Updated on 16-Aug-2023 10:50:58

70 Views

Sorting a vector using STL is a piece of cake. We can use the famous sort() function to perform the task. The real challenge is to count the number of factors for each number. A factor is a number which divides another number completely, i.e. with zero remainder. Traversing through ... Read More

P-Smooth Numbers or P-friable Number

Eva Sharma

Eva Sharma

Updated on 16-Aug-2023 10:47:44

75 Views

A number is p-friable for p-smooth if all of its prime factors are less than or equal to p. For example, 1620 is a 5-smooth number. Because, the prime factors of 1620 are: 2, 3, and 5. As it can be seen, 1620 is also a 7-smooth and 11-smooth number. ... Read More

Perfect Power (1, 4, 8, 9, 16, 25, 27, …)

Eva Sharma

Eva Sharma

Updated on 10-Mar-2023 12:35:48

740 Views

A Perfect Power is a Natural Number that is the product of equal natural factors. It can also be defined as an integer that can be expressed as a square power or a higher power of another integer greater than one. For example, 4 can be expressed as the product ... Read More

Legendre’s Conjecture: Concept, Algorithm, Implementation in C++

Eva Sharma

Eva Sharma

Updated on 10-Mar-2023 12:31:11

173 Views

The Legendre’s Conjecture states that at least one prime number always exists between two consecutive natural numbers' squares. Mathematically, there is always a prime number p between any two numbers n2 and (n+1)2. n is a natural number. A conjecture means a conclusion that doesn't has mathematical proof. Hence, Legendre's ... Read More

Form a Number Using Corner Digits of Powers

Eva Sharma

Eva Sharma

Updated on 10-Mar-2023 12:17:23

81 Views

What are Corner digits? The corner digits of a number refer to the rightmost and the leftmost digits. For example, the corner digits of 1234 are 1 and 4. The corner digits of a single-digit number will be the number twice. For example, the corner digits of 2 will be ... Read More

Decimal Equivalent of Gray Code and Its Inverse

Eva Sharma

Eva Sharma

Updated on 10-Mar-2023 12:08:16

910 Views

Gray code or reflected binary code is a form of a binary representation of numbers in which two consecutive numbers only differ by one bit. For example, the gray code of 1 is 001, while the gray code of 2 is 011. Gray code is usually used in error correction ... Read More

Cube Free Numbers smaller than n

Eva Sharma

Eva Sharma

Updated on 10-Mar-2023 12:01:22

185 Views

Cube-free numbers are those numbers that have no cubic divisors. A cubic divisor refers to an integer that is a cube and divides the number with zero remainders. For example, 8 is a cubic divisor of 16 since 8 is a cube of 2 (2*2*2 = 8), and 8 divides ... Read More

Square pyramidal number (Sum of Squares)

Eva Sharma

Eva Sharma

Updated on 10-Mar-2023 11:58:22

201 Views

A Square Pyramidal Number means the Sum of the Square of Natural Numbers. Natural Numbers include all the numbers from 1 to infinity. For example, the first 4 Square pyramidal numbers are 1, 5, 14, 30. For better perception, consider the fact: If we take spheres of numbers equal to ... Read More

Advertisements