OFFSET
1,6
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..20000
FORMULA
a(n) = Sum_{d|n} ((sigma(d)+1) mod 2).
EXAMPLE
a(24) = 4; The divisors d of 24 are {1, 2, 3, 4, 6, 8, 12, 24} with corresponding values of sigma(d) {1, 3, 4, 7, 12, 15, 28, 60}. There are 4 even values of sigma(d).
MATHEMATICA
Table[Sum[Mod[DivisorSigma[1, k] + 1, 2] (1 - Ceiling[n/k] + Floor[n/k]), {k, n}], {n, 100}]
f1[p_, e_] := e+1; f2[p_, e_] := If[p == 2, e+1, Floor[e/2] + 1]; a[n_] := Times @@ f1 @@@ (f = FactorInteger[n]) - Times @@ f2 @@@ f; a[1] = 0; Array[a, 100] (* Amiram Eldar, Oct 06 2023 *)
PROG
(PARI) a(n) = sumdiv(n, d, !(sigma(d) % 2)); \\ Michel Marcus, Jun 11 2021
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wesley Ivan Hurt, Jun 11 2021
STATUS
approved