Cyborg31
- 36
- 0
Homework Statement
Let h: Z -> Z be defined as follows:
h(n) = 0 if n is even and 1 if n is odd
Determine h^2, h^3, and h^500
Homework Equations
The Attempt at a Solution
If n is even, h(n) = 0 then h(h(n)) = h(0) = 0
If n is odd, h(n) = 1 then h(h(n)) = h(1) = 1
If n is even h(n) = 0 then h(h(h(n))) = h(h(0)) -> h(0) = 0
If n is odd h(n) = 1 then h(h(h(n))) = h(h(1)) -> h(1) = 1
Then for h^500, if n is even then the result is 0 and n is odd then the result is 1.
Can someone tell if that's correct?
Thanks.
Last edited: