OFFSET
0,2
COMMENTS
Iterating the map f always ends in one of the following cycles: (0) or (-i, -i+1).
We can build a variant of this sequence by replacing the constant 1+i appearing in the name by any Gaussian integer, say d, such that gcd(Re(d), Im(d)) = 1 and norm(d) > 1.
This sequence has similarities with A061313.
LINKS
EXAMPLE
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.
PROG
(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))))
CROSSREFS
KEYWORD
nonn
AUTHOR
Rémy Sigrist, May 26 2019
STATUS
approved