On the first glance the first problem seems quite impossible.
For example, if n is power of two, then for each prime number < n there will be a cycle starting with that number. If n is not a power of two, I haven't yet seen any good explanation of cycles.
Any hints? We can't use a or b in any way?