If you dont know binary you're screwed before you even started. Look up "binary" in wikipedia if you dont even know what it is.

A summary: Computers use binary to represent data, since computers work with circuits that have two states, off (0) and on (1). A computer can represent numbers, strings, or you're favourite MP3 as a string of 0's and 1's. Now that thats out of the way...

I don't like this one because it doesn't have a clear (single) correct answer. There are lots of formulas that give the given numbers. For example, one can construct (as already stated) a 4th-degree polynomial which takes on all the valued specified (or infinitely many polynomials of degree 5 or higher), and any of these qualify as a "formula."

It might help to give some clue as to what you had in mind, such as "The formula I have in mind only applies to integers, and it always gives an integer value." This at least rules out continuous mathematics and identifies it as a discrete problem, which is apparently what you intended.

I have noticed a few comments stating that the answer is not a function... however aside from the function above I posted (which is one solution), I now also post another function which fits the other solution. Almost anything can be made in to a function.

I have noticed a few comments stating that the answer is not a function... however aside from the function above I posted (which is one solution), I now also post another function which fits the other solution. Almost anything can be made in to a function.

I have noticed a few comments stating that the answer is not a function... however aside from the function above I posted (which is one solution), I now also post another function which fits the other solution. Almost anything can be made in to a function.