Anyone care to solve this?

Presumably n%2 means n mod 2. So this function is the basis of the Collatz Conjecture.

But the definition of the function is not in itself a "problem" that can be "solved". What are you asking for?
 
As a lover of math conundrums, I thought I would see if anyone knew about this.;) I thought you would.
 
You are making no sense. In your first post, you defined a function and asked "Anyone want to solve it?". Solve what? You solve "problems", you don't "solve" functions!
 
Forgive me. A slip of the finger. I forgot to tell you the variable that I wanted to use as a function of n.
N=2
 
I solved it: It goes to 1 after enough iterations.
I don't know how to prove that it always will make it back to 1 though... ;)
 
I can guess, although you really haven't said it, that the f(n)= n/2 if n is even and 3n+ 1 if n is odd. That is, as Dr. Peterson said, the "Collatz conjecture". And you want to determine what it goes to as n goes to infinity? No, it doesn't "go to 1" as a limit. For example, if we start with n= 10, that's even so next we have 5. That's odd so next we have 3(5)+ 1= 16. That's even so next we have 8. That's even so next we have 4. That's even so next we have 2 (in fact 16 is a power of 2 so get a sequence of lower powers of 2). Next we have 1 which is odd so next we have 3(1)+ 1= 4 and we get 4, 2. 1 over again and again and again. There is no limit, just repeating "4, 2, 1". That is the "Collatz conjecture" that, starting from any "n", you will eventually get a power of two and then "4, 2, 1" repeating. Terence Tao has proved that "almost all" starting values result in that, where "almost all" is given a specific meaning" but it has not been proved that counterexamples do or do not exist.
 
I can guess, although you really haven't said it, that the f(n)= n/2 if n is even and 3n+ 1 if n is odd. That is, as Dr. Peterson said, the "Collatz conjecture". And you want to determine what it goes to as n goes to infinity? No, it doesn't "go to 1" as a limit. For example, if we start with n= 10, that's even so next we have 5. That's odd so next we have 3(5)+ 1= 16. That's even so next we have 8. That's even so next we have 4. That's even so next we have 2 (in fact 16 is a power of 2 so get a sequence of lower powers of 2). Next we have 1 which is odd so next we have 3(1)+ 1= 4 and we get 4, 2. 1 over again and again and again. There is no limit, just repeating "4, 2, 1". That is the "Collatz conjecture" that, starting from any "n", you will eventually get a power of two and then "4, 2, 1" repeating. Terence Tao has proved that "almost all" starting values result in that, where "almost all" is given a specific meaning" but it has not been proved that counterexamples do or do not exist.
Thanks!
 
Top