Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #10 Feb 19 2023 12:31:31
%S 1,-1,-1,1,1,1,-1,-1,-1,-1,1,-1,1,1,-1,1,1,1,-1,1,1,-1,-1,1,-1,-1,-1,
%T -1,1,1,1,-1,-1,-1,-1,-1,1,1,-1,-1,1,-1,1,1,-1,1,1,-1,1,1,-1,1,1,1,1,
%U 1,1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,1,1,-1,1,-1,-1,1
%N Multiplicative with a(p^k) = 1 or -1 so as to minimize abs(Sum_{m = 1..p^k} a(m)); in case of a tie, a(p^k) = a(p^k-1).
%C The partial sums (A360711) show oscillations of increasing magnitude.
%e For n = 1, a(1) = 1 (as this sequence is multiplicative).
%e For n = 2, abs(1 + 1) > abs(1 - 1), so a(2) = -1.
%e For n = 3, abs(1 - 1 + 1) = abs(1 - 1 - 1), so a(3) = a(3-1) = -1.
%o (PARI) { my (s=0, f); for (n=1, #a=vector(75), f=factor(n); print1 (a[n]=if (#f~==1, if (s, -sign(s), a[n-1]), prod(k=1, #f~, a[f[k, 1]^f[k, 2]]))", "); s+=a[n]) }
%Y Cf. A360711 (partial sums).
%K sign,mult
%O 1
%A _Rémy Sigrist_, Feb 17 2023