%N Let f(1) = 1, f(2) = 1 + i (where i denotes the imaginary unit), and for n > 1, f(n+1) is the Gaussian integer in the first quadrant (with positive real part and nonnegative imaginary part) with least modulus and sharing a prime factor with f(n) (in case of a tie, minimize the imaginary part); a(n) = the imaginary part of f(n).
%C See A319561 for the square of the modulus of f and additional comments.
%H Rémy Sigrist, <a href="/A319563/b319563.txt">Table of n, a(n) for n = 1..10000</a>
%H Rémy Sigrist, <a href="/A319563/a319563.gp.txt">PARI program for A319563</a>
%o (PARI) See Links section.
%Y Cf. A319561.
%A _Rémy Sigrist_, Sep 23 2018