OFFSET
1,2
COMMENTS
A completely multiplicative sign sequence is a sequence S with values in {-1,+1} satisfying S(j*k) = S(j)*S(k).
Such a sequence S is completely determined by its values at the primes. Hence S(k^2) = +1 for every k, and the number of completely multiplicative sign sequences of length n is 2^A000720(n).
For fixed k, the sum of S(k) over all choices of S is 0 unless k is a square. Indeed, if k is not a square, then some prime occurs with an odd exponent in k, and changing the sign assigned to that prime pairs the choices of S with opposite values of S(k). If k is a square, then S(k) = 1 for every S. Hence a(n) = A000196(n)*2^A000720(n).
FORMULA
EXAMPLE
For n = 5 there are 2^primepi(5) = 8 completely multiplicative sign sequences, namely +--+-, +--++, +-++-, ++-+-, +-+++, ++-++, ++++- and +++++. Hence a(5) = (-1) + 1 + 1 + 1 + 3 + 3 + 3 + 5 = 16.
MATHEMATICA
a[n_Integer?NonNegative] := Floor[Sqrt[n]]*2^PrimePi[n]; Table[a[n], {n, 52}]
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Bartlomiej Pawlik, May 20 2026
STATUS
approved
