Problem 53880. List the vile numbers

Evil numbers, the subject of Cody Problem 2733 have an even number of ones in their binary representations, whereas odious numbers, the subject of Cody Problem 2734, have an odd number of ones in their binary representations. For example, the numbers 3, 6, 10, and 12 are evil, and the numbers 2, 4, 7, and 14 are odious.
Vile numbers have binary representations that end with an even number of zeros (including zero zeros). Therefore, the numbers 3 and 12 are evil and vile, and the numbers 4 and 7 are odious and vile. The numbers 6 and 10 are evil but not vile, and the numbers 2 and 14 are odious but not vile. Got it?
Write a function to determine the nth vile number.

Solution Stats

35.48% Correct | 64.52% Incorrect
Last Solution submitted on Apr 18, 2023

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers10

Suggested Problems

More from this Author284

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!