OFFSET
1,6
COMMENTS
If the number of divisors (nd) of n > 1 is odd, then a(n) = -1, else a(n) = nd/2. - Michel Marcus, Sep 14 2017
First occurrence of k beginning with -1 is A293570(r). - Robert G. Wilson v, Oct 10 2017
Records occur for A293570(r): 4, 6, 12, 24, 48, 60, 192, 240, 3072, 12288, 196608, 786432, 12582912, 805306368, etc. - Robert G. Wilson v, Oct 10 2017
LINKS
FORMULA
EXAMPLE
a(10) = 2 because divisors of 10 are 1,2,5,10 with product 100 = 10^2.
MATHEMATICA
Table[Boole[n == 1] + If[OddQ@ #, -1, #/2] &@ DivisorSigma[0, n], {n, 100}] (* Michael De Vlieger, Sep 15 2017 *)
PROG
(PARI) a(n) = if (n==1, 0, my(nd = numdiv(n)); if (nd % 2, -1, nd/2)); \\ Michel Marcus, Sep 14 2017
(PARI) a(n)=my(k=numdiv(n)); if(k%2, if(n>1, -1, 0), k/2) \\ Charles R Greathouse IV, Sep 19 2017
CROSSREFS
KEYWORD
sign
AUTHOR
Juri-Stepan Gerasimov, Sep 13 2017
EXTENSIONS
Definition corrected by Charles R Greathouse IV, Sep 13 2017
STATUS
approved