My second question here. Does it show that I know very little about mathematics? :)
I'm doing Project Euler Question 14 and would like to know what the right arrow → means in:
n → n/2 (n is even)
n → 3n + 1 (n is odd)
I gather from the phrasing of the question that it has to do with set theory.
Any links to primers on set theory that would help me to understand the question greatly appreciated.
Thanks.
This notation is used to define a function. Usually, one would write
to defined a function (let's call it $f$) such that $f(n)=n/2$ if $n$ is even and $f(n)=3n+1$ if $n$ is odd.
P.S. - This particular function is sometimes called the Collatz function. You can read more about it on Wikipedia.