Can someone help me with my homework?
If n is even divide by 2
If n is odd multiply by 3 and add one.
Prove that it always gets to 1. It's pretty simple 3rd grade homework so surely /sci/ is smart enough to figure it out.
>>8571101
Contradiction.
4 is even so I divide it by 2... and it yields 2. So your little "memeorem" is false. What a dumb question.
Now... if you were to compose that function with itself many many times then...
>>8571101
it's impossible we call it a conjecture(i dont have the name of it)
>>8571101
Use this Matlab code:
clear
clc
n = input('Enter a number ');
while n ~= 1
if mod(n,2) == 0
n = n/2
else
n = 3*n + 1
end
end
This code is an application of the processes you talked about. Here no matter what number you give n, the result will always come out to be 1.
>>8571101
for n even:
after iteration i: n*=n/2i
any number even number can be represented by a product of 2.
for odd n:
n*=3n+1
odd*odd=odd
odd+1=even
hence n*=even
>>8571702
wait wtf this is correct
>>8571111
4: 4/2 = 2, 2/2 = 1
5: 5*3+1 = 16, 16/2 = 8, 8/2=4, 4/2=2, 2/2=1
>>8571754
Yeah, you're right I'm a giant brainlet
>>8571746
>wait wtf this is correct
no
can be rewritten as
x/2 if x is even
(3n+1)/2 if x is odd
since 3n+1 is always even.
(3(2n+1)+1)/2 alternates between even and odd.
already this seems like it converges.
gonna be embarrassed once i figure out how easy this is.
you fags. is it really an open question? it seems like it should be easy.
fucking integers.......
7/10 made me reply and think hard for a while
Fear not gentlemen. There is a $500 prize if you get it.
That's like, 30 pizzas!