Colin’s Number Game

My friend Col­in shared this lit­tle num­ber game on Face­book a while back as a game in which he was giv­en a num­ber, would do some mag­ic with it, and then return a mag­ic num­ber. As a chal­lenge to myself, I sought to auto­mate the game. This is a result of that.

The game is sim­ple: You pro­vide the game an inte­ger (pos­i­tive or neg­a­tive), and the game will find its mag­ic num­ber. Your task is to deter­mine why the mag­ic num­ber is what it is.

Don’t for­get to share with your friends to stump them!

The Orion Oratory