login
A360710
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).
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, -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, 1, 1, -1, -1, -1, -1, -1, 1, -1, 1, 1, -1, 1, 1, 1, -1, 1, -1, -1, 1
OFFSET
1
COMMENTS
The partial sums (A360711) show oscillations of increasing magnitude.
EXAMPLE
For n = 1, a(1) = 1 (as this sequence is multiplicative).
For n = 2, abs(1 + 1) > abs(1 - 1), so a(2) = -1.
For n = 3, abs(1 - 1 + 1) = abs(1 - 1 - 1), so a(3) = a(3-1) = -1.
PROG
(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]) }
CROSSREFS
Cf. A360711 (partial sums).
Sequence in context: A337004 A343785 A359738 * A269529 A325931 A156734
KEYWORD
sign,mult
AUTHOR
Rémy Sigrist, Feb 17 2023
STATUS
approved