OFFSET
1,2
COMMENTS
The first negative term occurs at a(223) = -1.
After a(2457) = -1 the sequence dips next time to the negative side at n=218351.
No other negative terms after a(2346395) = -1 in range 1 .. 2^25.
In range 1..(2^25) the maximum value is a(23963418) = 8326 and there are 1252224 negative terms in that range (less than 4%).
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..35000
MATHEMATICA
nn = 200; f[n_] := (Times @@ Power[If[# == 1, 1, NextPrime@ #] & /@ First@ #, Last@ #] + 1)/2 &@ Transpose@ FactorInteger@ n; g[n_] := Times @@ Power[If[# == 1, 1, NextPrime[#, -1]] & /@ First@ #, Last@ #] &@ Transpose@ FactorInteger[2 n - 1]; s = Select[Range@ nn, Xor[EvenQ@ f@ #, OddQ@ g@ #] &]; t = Select[Range@ nn, Xor[EvenQ@ f@ #, EvenQ@ g@ #] &]; Table[Count[s, k_ /; k <= n] - Count[t, k_ /; k <= n], {n, nn/2}] (* Michael De Vlieger, Mar 17 2016 *)
PROG
(PARI)
default(primelimit, 2^30);
A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ From Michel Marcus
A064989(n) = {my(f); f = factor(n); if((n>1 && f[1, 1]==2), f[1, 2] = 0); for (i=1, #f~, f[i, 1] = precprime(f[i, 1]-1)); factorback(f)};
CROSSREFS
KEYWORD
sign
AUTHOR
Antti Karttunen, Mar 17 2016
STATUS
approved