Question: Magic Numbers A positive integer is magic if , and only if , it can be reduced to 1 by repeatedly dividing it by 2

Magic Numbers
A positive integer is magic if, and only if, it can be reduced to 1 by repeatedly dividing it by 2 if its
even or multiplying it by 3 and then adding 1 if its odd. One is magic by definition. Two is even and
2/2=1. So, for a better example, 3 is magic because 3 reduces first to 10(3*3+1), then to 5(10/2), then
to 16(5*3+1), then to 8(16/2), then to 4(8/2), then to 2(4/2), and finally to 1(2/2). Mikes magic
numbers hypothesis states that all positive integers are magic, or, formally: x in Z, MAGIC(x) where
MAGIC(x) is the predicate x is magic

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!