Problem 57869. Identify de Polignac numbers
The numbers 125 and 329 can be written as the sum of a prime and a power of 2. For example,
, and
. The numbers 127 and 331, which are examples of de Polignac numbers, cannot be written in this way.
Write a function that determines whether an odd number is a de Polignac number.
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers19
Suggested Problems
-
17693 Solvers
-
"Low : High - Low : High - Turn around " -- Create a subindices vector
548 Solvers
-
Construct an index vector from two input vectors in vectorized fashion
399 Solvers
-
641 Solvers
-
1092 Solvers
More from this Author292
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!