OFFSET
1,2
COMMENTS
Equivalently, numbers k such that there exists a unit group (Z[i]/(x + yi))* of order k.
For any complex number z, the analog of the Euler product formula for Gaussian integers is N(z)*Product_{p|z} 1 - 1/N(p), where p is a Gaussian prime and N(z) is the norm of z.
Under a multiplication which is not completely multiplicative, the values of Euler's totient function for rationals can be obtained by taking the products of the set {(p-1)*p^(e-1)} over all primes p. The present sequence is generated from the set {(p-1)*p^(r-1), (q^2-1)*(q^2)^(s-1)} = {phi(p^r), J_2(q^s)}, where J_2 is Jordan's totient function, for primes p and q such that p = 2, p == 1 mod 4, and q == 3 mod 4.
The above rules can be generalized to quadratic integer rings which are UFDs: in this case the generating set {(p-1)*p^(r-1), (q^2-1)*(q^2)^(s-1)} is taken over primes p and q where p is either a ramified or split prime, and q is inert. See the Englezou link for a PARI program. Note that the program lst_d(lim, d) generates a subset of the set of totient values of Z[sqrt(d)] for all nonzero integers d; it is only for those d such that Z[sqrt(d)] is a UFD that this subset is equal to the full set.
LINKS
Miles Englezou, Table of n, a(n) for n = 1..10000
Miles Englezou, PARI program for general quadratic integer rings
EXAMPLE
2 is a term since for z = 2 = -i(1 + i)^2, N(-i(1 + i)^2)(1 - 1/N(1 + i)) = 4 * 1/2 = 2.
4 is a term since for z = 2 + i, N(2 + i)(1 - 1/N(2 + i)) = 5 * 4/5 = 4.
8 is a term since for z = 4 - 2i = (2 + i)(1 + i)^2, N(4 + 2i)(1 - 1/N(2 + i))(1 - 1/N(1 + i)) = 20 * 4/5 * 1/2 = 8.
PROG
(PARI) lst(lim) = my(S = Set([1])); forprime(p=2, lim, my(L = List()); if(p==2, for(e=1, oo, my(v = 2^(e-1)); if(v > lim, break); listput(L, v)), if(p%4==1, for(e=1, oo, my(v = p^(e-1)*(p-1)); if(v > lim, break); listput(L, v)), for(e=1, oo, my(v = (p^2)^(e-1)*(p^2-1)); if(v > lim, break); listput(L, v)))); my(T = Set(S)); for(i=1, #S, for(j=1, #L, my(v = S[i]*L[j]); if(v <= lim, T = setunion(T, Set([v]))))); S = T); S
CROSSREFS
KEYWORD
nonn
AUTHOR
Miles Englezou, Apr 13 2026
STATUS
approved
