OFFSET
0,3
COMMENTS
Setting m=2 in
log(m) = Sum_{n>0} (n mod m - (n-1) mod m)/n [1]
yields the sum
log(2) = (1 -1/2) +(1/3 -1/4) +(1/5 -1/6)+...
Substituting every -1/d by 1/d - 2/d we obtain
log(2) = (1+1/2-1)+(1/3+1/4-1/2)+(1/5+1/6-1/3)+...
a(n) is the sequence of denominators of this modified sum with unit numerators, so
Sum_{k>0} 1/a(k) = log(2)
Substituting -1/d by -2/d + 1/d would yield another permutation (one positive, one negative, one positive) with the same sum of inverses.
Similar sequences (m positives, one negative) may be obtained for the logarithm of any integer m>0. A001057 is the case m=1, with sum of inverses log(1).
Equation [1] is a result of expanding log( Sum_{0<=k<=m-1} x^k ) at x=1 (see comment to A061347.)
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..10000
Wikipedia, Riemann series theorem
Index entries for linear recurrences with constant coefficients, signature (0,0,2,0,0,-1).
FORMULA
G.f.: (x*(1+2*x-x^2+x^3)/((1-x)^2*(1+x+x^2)^2)).
a(0)=0, a(1)=1, a(2)=2, a(3)=-1, a(4)=3, a(5)=4, a(n)=2*a(n-3)-a(n-6), n>=6.
MATHEMATICA
LinearRecurrence[{0, 0, 2, 0, 0, -1}, {0, 1, 2, -1, 3, 4}, 100] (* G. C. Greubel, May 24 2016 *)
Join[{0}, With[{nn=50}, Riffle[Range[nn], Range[-1, -nn/2, -1], 3]]] (* Harvey P. Dale, May 15 2023 *)
PROG
(PARI) a(n)=(2*(n+1)\3)*(1-3/2*!(n%3))
(PARI) a(n)=if(n>=0, [ -n\3, 2*(n\3)+1, 2*(n\3)+2][n%3+1]) \\ Jaume Oliver Lafont, Nov 14 2009
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Jaume Oliver Lafont, Oct 18 2009
EXTENSIONS
Corrected by Jaume Oliver Lafont, Oct 22 2009
frac keyword removed by Jaume Oliver Lafont, Nov 02 2009
STATUS
approved