A308431 For any Gaussian integer z, let f(z) = z / (1+i) when z is a multiple of 1+i and f(z) = z+1 otherwise (where i denotes the imaginary unit). a(n) gives the number of iterations of the map f, starting with n, needed to reach a cycle.
0, 2, 1, 6, 5, 9, 8, 11, 10, 10, 9, 12, 11, 14, 13, 11, 10, 15, 14, 12, 11, 14, 13, 18, 17, 15, 14, 19, 18, 21, 20, 10, 9, 22, 21, 11, 10, 13, 12, 17, 16, 14, 13, 18, 17, 20, 19, 15, 14, 21, 20, 16, 15, 18, 17, 21, 20, 19, 18, 22, 21, 24, 23, 14, 13, 25, 24
Offset: 0
Keywords
Examples
For n = 4: - 4 is a multiple of 1+i, hence f(4) = 4/(1+i) = 2-2*i, - 2-2*i is a multiple of 1+i, hence f(2-2*i) = (2-2*i)/(1+i) = -2*i, - -2*i is a multiple of 1+i, hence f(-2*i) = -2*i/(1+i) = -1-i, - -1-i is a multiple of 1+i, hence f(-1-i) = (-1-i)/(1+i) = -1, - -1 is not multiple of 1+i, hence f(-1) = -1+1 = 0, - 0 belongs to the cycle (0), hence a(4) = 5.
Links
Crossrefs
Cf. A061313.
Programs
-
PARI
a(z) = for (k=0, oo, if (z==0||z==-I||z==-I+1, return (k), if ((real(z)+imag(z))%2, z++, z/=(1+I))))
Comments