Rinish Patidar has Published 22 Articles

Position of n among the numbers made of 2, 3, 5 & 7

Rinish Patidar

Rinish Patidar

Updated on 18-Apr-2023 15:36:38

The problem statement includes printing the position of n among the numbers made of 2, 3, 5 and 7, where n will be any positive number given by the user. The numbers made of 2, 3, 5 and 7 means this will be the sequence of the strictly increasing numbers ... Read More

Java Math incrementExact(int x) method

Rinish Patidar

Rinish Patidar

Updated on 18-Apr-2023 15:31:52

We will explore Java Math incrementExact(int x) method by using the function in Java and understanding its different functionalities. An incrementExact() function is an in-built function in Java in the Math library. This function is used to return a value equal to the parameter passed in the function increased by ... Read More

Level order traversal with direction change after every two levels(Implementation in C/C++)

Rinish Patidar

Rinish Patidar

Updated on 20-Mar-2023 16:06:06

Level Order TraversalThis is one of the algorithms that processes or prints all nodes of a binary tree by traversing through depth, starting at the root and moving on to its children and so forth.Example INPUT − OUTPUT − 2 4 7 3 6 11 ... Read More

Vieta’s Formulas

Rinish Patidar

Rinish Patidar

Updated on 16-Mar-2023 11:01:17

In mathematics, Vieta’s formulas are the concept of polynomials which relates a polynomial’s coefficients to the sums and products of the roots of the polynomial. Vieta’s formulas can be useful tools for learning relations between the polynomial’s roots without really knowing their numerical value and coefficients of the equation. We ... Read More

Subsequence of size k with maximum possible GCD

Rinish Patidar

Rinish Patidar

Updated on 16-Mar-2023 10:58:17

The problem statement says we will be given an array as input and a positive integer K, we need to figure out the maximum possible gcd(greatest common divisor) of a ksized subsequence of an array in this problem. It can be solved using different algorithms to find gcd of the ... Read More

Smarandache-Wellin Sequence

Rinish Patidar

Rinish Patidar

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

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 ... Read More

Program to compare m^n and n^m

Rinish Patidar

Rinish Patidar

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

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 ... Read More

Heptagonal number

Rinish Patidar

Rinish Patidar

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

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 ... Read More

Find the GCD that lies in given range

Rinish Patidar

Rinish Patidar

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

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) ... Read More

Check whether a given number is Polydivisible or Not

Rinish Patidar

Rinish Patidar

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

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 ... Read More

Advertisements