OFFSET
1,2
COMMENTS
Divisors which are associates are identified (two Gaussian integers z1, z2 are associates if z1 = u * z2 where u is a unit, i.e., one of 1, i, -1, -i).
FORMULA
Presumably a(n) = 2 iff n is a rational prime == 3 mod 4 (see A045326). - N. J. A. Sloane, Jan 07 2003, Feb 23 2007
Multiplicative with a(2^e) = 2*e+1, a(p^e) = e+1 if p mod 4=3 and a(p^e) = (e+1)^2 if p mod 4=1. - Vladeta Jovovic, Jan 23 2003
EXAMPLE
For example, 5 has divisors 1, 1+2i, 2+i and 5.
MAPLE
a:= n-> mul(`if`(i[1]=2, 2*i[2]+1, `if`(irem(i[1], 4)=3,
i[2]+1, (i[2]+1)^2)), i=ifactors(n)[2]):
seq(a(n), n=1..100); # Alois P. Heinz, Jul 09 2021
MATHEMATICA
Table[Length[Divisors[n, GaussianIntegers -> True]], {n, 30}] (* Alonso del Arte, Jan 25 2011 *)
DivisorSigma[0, Range[90], GaussianIntegers->True] (* Harvey P. Dale, Mar 19 2017 *)
PROG
(Haskell)
a062327 n = product $ zipWith f (a027748_row n) (a124010_row n) where
f 2 e = 2 * e + 1
f p e | p `mod` 4 == 1 = (e + 1) ^ 2
| otherwise = e + 1
-- Reinhard Zumkeller, Oct 18 2011
(PARI)
a(n)=
{
my(r=1, f=factor(n));
for(j=1, #f[, 1], my(p=f[j, 1], e=f[j, 2]);
if(p==2, r*=(2*e+1));
if(p%4==1, r*=(e+1)^2);
if(p%4==3, r*=(e+1));
);
return(r);
} \\ Joerg Arndt, Dec 09 2016
CROSSREFS
KEYWORD
nonn,nice,mult
AUTHOR
Reiner Martin, Jul 12 2001
STATUS
approved