Woodall Number - Python Program

Woodall+Number

Given a number N. The task is to check if N is Woodall number or not. A Woodall Number is of the form:

Wn = n.2n – 1

The first few Woodall numbers are: 1, 7, 23, 63, 159, 383, 895……

Example 1:

Input: N = 383
Output: 1
Explanation: 6*26 - 1 = 383.

Example 2:

Input: N = 200
Output: 0
Explanation: This is not a Woodall number.
Woodall+number+solution

Solution : Replit

Interested in Coding classes please join ZugZwang Academy.

For More Updates Subscribe to Algothink by Bharat Divyang (IIT/IIM).

Previous
Previous

Maximum Collatz sequence length | Collatz Conjecture

Next
Next

Euler’s Totient function