Legendre's Conjecture: Concept, Algorithm, and Implementation in C++

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

283 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 Conjecture is just a statement with no mathematical proof. Problem Statement For a number n, print the number of primes in the range of n2 to (n+1)2 from 1 to n. Examples Input: 4 Output: For i = 1: Total primes in the range 1 and 4 = 2 ... Read More

Form a Number Using Corner Digits of Powers

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

162 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 2 and 2. Problem Statement For given two numbers, n, and x, form a number using the corner digits of all the powers of n from 1 and x, i.e., n1, n2....nx. Examples Input: n = 2, x = 4 Output: 22448816 Explanation 21 = 2. Corner digits = ... Read More

Decimal Equivalent of Gray Code and Its Inverse

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

1K+ 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 because it prevents some data errors that can happen in the usual binary representations while state changes. Gray code is also helpful in k-maps, communication, etc., because of its unique property. Prerequisite Study decimal, binary and gray code notations before reading further. Problem Statement 1 Given a decimal number n, ... Read More

Best ThopTV Alternatives

Shirjeel Yunus
Updated on 10-Mar-2023 12:04:03

21K+ Views

What is ThopTV? ThopTV is an Indian app where you will be able to stream your favorite TV channels from more than 300 available. The app provides HD streaming free of cost. The app has Hindi channels along with many others that are popular worldwide. You will be able to watch videos, series, shows, movies, and other things. Why there is a need for ThopTV alternatives? ThopTV has become very popular and free of cost. Many users started using the app and enjoyed entertainment. Later, the app started facing problems due to regular server crashes alternatives for the app are ... Read More

Cube Free Numbers Smaller Than N

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

371 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 16 with the remainder of zero. Thus, 8 and 16 both are not cube-free numbers. Problem Statement Find all the cube-free numbers less than a given number, n. Example Let's understand the problem with an example. Let n = 15, Thus, we have to find all the numbers less than ... Read More

Square Pyramidal Number Sum of Squares

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

321 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 the square pyramidal numbers, starting from one, and stack them in descending order, they create a pyramid. Problem Statement Given a number Sum. If Sum is the sum of the squares of first “n” natural numbers, return n, otherwise return false. Example 1 Input = 30 Output = 4 ... Read More

Importance of Rotation in PCs

Premansh Sharma
Updated on 10-Mar-2023 11:50:56

2K+ Views

Introduction A common statistical method used in many fields of data analysis and machine learning is principal component analysis (PCA). By transferring a dataset to a lower-dimensional space while retaining the majority of the original variables, it is frequently used to decrease the dimensionality of a dataset. The choice of the coordinate system, however, can significantly affect the outcomes of PCA. The idea of rotation enters the picture at this point. We may more clearly comprehend the underlying structure of the data and enhance the results' interpretability by rotating the coordinate system. We will examine the value of rotation in ... Read More

Screen for Outliers and Deal with Them

Premansh Sharma
Updated on 10-Mar-2023 11:45:37

205 Views

Introduction Data points that stand out from the bulk of other data points in a dataset are known as outliers. They can distort statistical measurements and obscure underlying trends in the data, which can have a detrimental effect on data analysis, modeling, and visualization. Therefore, before beginning any study, it is crucial to recognize and handle outliers. In this post, we'll look at different methods for dealing with outliers as well as how to check for them. Screening for Outliers We must first recognize outliers in order to deal with them. Here are a few popular techniques for identifying outliers ... Read More

Implementation of Linked List in JavaScript

Pranay Arora
Updated on 10-Mar-2023 11:41:26

8K+ Views

A linked list is a data structure that consists of a sequence of elements, each of which contains a reference (or "link") to the next element in the sequence. The first element is called the head and the last element is called the tail. Linked lists have many advantages over other data structures. Now we shall look at how to implement Linked list using JavaScript. Defining the Node Class and the LinkedList class This is basically the prerequisite in order to implement a linked list in JavaScript. In this step, 2 classes namely one for the nodes and the other ... Read More

Encode a Message Using Playfair Cipher in Java

Pranay Arora
Updated on 10-Mar-2023 11:31:25

3K+ Views

Encrypting is the task of transforming information into an unreadable format or cipher text. It is usually done to protect the confidentiality of information. There are many ways and algorithms to encrypt data. One such example is the Playfair cipher algorithm. In this article, we are going to see how to write a Java program to encode a message using Playfair cipher. Playfair cipher makes use of a 5X5 grid or matrix and a set of pre-defined rules. To encrypt, we require a key and the plain text to be encrypted. Steps Now let us see the steps to encrypt ... Read More

Advertisements