riddle of the week
This article is originally published at https://xianblog.wordpress.com
The Riddler of April 1 offered this simple question:
start with the number 1 and then try to reach a target number through a series of steps. For each step, you can always choose to double the number you currently have. However, if the number happens to be one (1) more than an odd multiple of 3, you can choose to “reduce” — that is, subtract 1 and then divide by 3. What is the smallest positive integer one cannot reach this way?
Which I turned into R steps (while waiting for flight AF19 to Paris)
while((!(x-1)%%3)&((x-1)%%6)){ oor[2*x]TRUE oor[x<-(x-1)%/%3]=TRUE}
but running an exhaustive search till 10⁸ did not spot any missing integer… Maybe an April fool joke (as the quick riddle was asking for the simplest representation of (x-a)(x-b)…(x-z)…!)
Thanks for visiting r-craft.org
This article is originally published at https://xianblog.wordpress.com
Please visit source website for post related comments.