riddle of the week

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)…!)

6 Responses to “riddle of the week”

  1. Laurence D. Robinson Says:

    So am I to conclude that all integers can be reached by this procedure, that this result follows from the Collatz conjecture, and that I just wasted a dozen hours working on this riddle this last weekend? Well, the jokes on you, because I had fun!

  2. I’m surprised you didn’t recognize it : I immediately saw it was teh Collatz Conjecture stated in reverse.

  3. Inded, this was an AF riddle, with all integers less than 10⁶ attainable by this procedure.

  4. […] article was first published on R – Xi'an's Og, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here) […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: