login
A072614
a(n) = Sum_{k = 1..n} (-1)^(n reduced mod k).
1
1, 2, 1, 2, 1, 4, -1, 4, 1, 4, -1, 6, -3, 8, -1, 4, -1, 8, -5, 10, -3, 8, -5, 10, -5, 10, -3, 8, -5, 14, -11, 14, -7, 12, -5, 12, -9, 14, -7, 12, -9, 18, -15, 20, -9, 14, -11, 16, -11, 18, -11, 16, -13, 22, -15, 20, -13, 18, -15, 24, -21, 26, -15, 18, -11, 20, -17, 22, -15, 24, -21, 28, -25, 30, -19, 24, -17, 26, -23, 28, -19, 24
OFFSET
1,2
LINKS
FORMULA
Lim_{n -> infinity} abs(a(n))/n = C = 0.30684(3)....
MATHEMATICA
Table[ Sum[(-1)^ Mod[n, k], {k, 1, n}], {n, 1, 81} ]
PROG
(PARI) a(n)=sum(k=1, n, (-1)^(n%k))
CROSSREFS
Sequence in context: A164799 A274451 A193787 * A287597 A238552 A257523
KEYWORD
sign
AUTHOR
Benoit Cloitre, Aug 10 2002
STATUS
approved