Smarandache-Wellin Sequence

Rinish Patidar
Updated on 16-Mar-2023 10:55:17

370 Views

The problem includes printing first m terms of Smarandache-Wellin Sequence where m is any positive integer. We will see the algorithm to print the first m term of Smarandache-Wellin Sequence in C++. But before that we must know about the Smarandache-Wellin sequence. A Smarandache-Wellin sequence is a sequence of Smarandache-Wellin numbers. Smarandache-Wellin numbers are the integers which are formed by concatenation of the consecutive prime numbers. The first few prime numbers are 2, 3, 5, 7, 11, 13, 17, 19, 23…. The first Smarandache-Wellin number of the sequence is 2. The second number of the sequence is 23, which ... Read More

Compare m^n and n^m

Rinish Patidar
Updated on 16-Mar-2023 10:53:12

351 Views

The problem statement states that we need to write a program to compare m^n and n^m. We need to figure out the algorithm to calculate $m^{n}$ and $n^{m}$ and compare them and print accordingly if $m^{n}$ is greater than $n^{m}$, or if $m^{n}$ is less than $n^{m}$ , or if they both are equal. We will be given two positive numbers, m and n and we need to find out $m^{n}$ and $n^{m}$ and compare both the values. For example, INPUT : m=2 , n=5 OUTPUT : m^n is greater than n^m. Explanation : $m^{n}$ which is 25 = 32 ... Read More

Heptagonal Number

Rinish Patidar
Updated on 16-Mar-2023 10:47:04

465 Views

A heptagonal number is a number which can be represented as a heptagon. A heptagon is a polygon with 7 sides. A heptagonal number can be represented as a combination of successive layers of heptagon( 7-sided polygon). Heptagonal number can be better explained with the below figures. The first heptagonal number is 1. Thus, it can be represented by a single dot. The second heptagonal number is 7 which can be represented by a heptagon. The third heptagonal number is 18 which can be represented as a heptagon and combined with a successive layer of heptagon. ... Read More

Find the GCD That Lies in Given Range

Rinish Patidar
Updated on 16-Mar-2023 10:25:14

651 Views

The problem states that we need to find the GCD that lies in the given range. We will be given two positive integers, x and y and two integers p and q which will be the range as [p, q]. We need to find out the GCD (greatest common divisor) of the numbers x and y falling under the range [p, q]. GCD, known as greatest common divisor in mathematics, is the greatest positive integer dividing each of two given positive integers. The given integers must not be zero. It is represented as gcd(x, y) for any two positive integers ... Read More

Check If a Number Is Polydivisible

Rinish Patidar
Updated on 16-Mar-2023 10:22:33

423 Views

The problem statement includes checking whether a given number is Polydivisible or not for any given integer N. A polydivisible number, also known as magic number, is a number following a unique pattern. The number created by first p digits of the given number should always be divisible by p and there should not be any leading zeros in the given number. If a number satisfies these properties, it is a Polydivisible number, else it is not. Here, p should be in range (1, total digits in the given number). Let’s understand the concept of polydivisible number with an example: ... Read More

Check If the N-th Term is Odd or Even in a Fibonacci-like Sequence

Rinish Patidar
Updated on 16-Mar-2023 10:18:26

381 Views

Our task in this problem is to check if the n-th term of a fibonacci like sequence is odd or even. A fibonacci sequence is a type of sequence in mathematics where each number in the sequence is the sum of the preceding two numbers. A nth term of the fibonacci sequence can be represented as − $$\mathrm{Fn\:=\:F_{n-1}\:+\:F_{n-2}}$$ The first few numbers of the fibonacci sequence are 0, 1, 1, 2, 3, 5, 8, 13, 21, 34….. The first two numbers of the sequence are 0 and 1. The next numbers are the sum of the preceding two ... Read More

Centered Tridecagonal Number

Rinish Patidar
Updated on 16-Mar-2023 10:14:12

220 Views

The problem statement states that we need to print the N-th centred Hexadecagon numbers for any positive number N. Tridecagonal numbers are the numbers that represent a tridecagon in itself. A tridecagon in mathematics is a polygon which has 13 sides. A centred tridecagonal numbers are the numbers that can be represented in the form of a dot in the centre followed by other dots surrounding it in successive layers of tridecagon which is nothing but a 13-sided polygon. Let’s understand the concept of centred tridecagonal numbers better with the figures. The first centred tridecagonal number can just ... Read More

Centered Hexadecagonal Number

Rinish Patidar
Updated on 16-Mar-2023 10:01:42

223 Views

Hexadecagonal numbers are the numbers that represent a hexadecagon. Hexadecagon is a polygon which consists of 16 sides. A Centred Hexadecagonal number is the number represented by a dot in the centre and other dots surrounding it in the successive hexadecagonal layers i.e. 16 sided polygon. We can understand the centred hexadecagonal number better with the below figures. There is a single dot in the centre for the first centred hexadecagon number. So the first centred hexadecagonal number will be 1. There is a single dot followed by a hexadecagon surrounding it in the next centred hexadecagon number. ... Read More

Modeling the Secant Method in Python

Dr Pankaj Dumka
Updated on 15-Mar-2023 17:05:48

3K+ Views

Secant method is one of the powerful methods to know the x-intercept (zeros) of a polynomial or any transcendental function. In this method, first we select (basically guess) the interval in which we expect the root ($\mathrm{𝑥_{1}}$, $\mathrm{𝑥_{2}}$). Then we draw a secant line to join the points on the function (A, B) corresponding to the guessed values as shown in the figure below. The secant line intersects the x-axis at the point $\mathrm{𝑥_{3}}$, as $\mathrm{𝑥_{3}}$ and $\mathrm{𝑥_{2}}$ are not close (i.e., their absolute difference is finite) we find the point corresponding to 𝑥3 on the curve i.e., C. ... Read More

Modeling the Regula Falsi Method in Python

Dr Pankaj Dumka
Updated on 15-Mar-2023 16:46:15

2K+ Views

In this tutorial, I will show you how to find the roots of an equation with the help of Regula Falsi which is also called as the "False Position Method". Let us consider the figure shown below. First we have searched for two 𝑥 values $\mathrm{x_{1}}$ and $\mathrm{x_{2}}$ at which the value of function ($\mathrm{y_{1}} $and $\mathrm{y_{2}}$) are different, means the points should be such that the products of these two should be negative (i.e. they should lie on the opposite sides of the X-axis). As these are not the exact point i.e. the points at which root exist, ... Read More

Advertisements