login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A374981
a(n) = (n^2 - 1)/6 - Sum_{t=0..n-1} [ A000217(t)/n ], where [ x ] means the fractional part of x here.
1
0, 0, 1, 1, 3, 4, 6, 7, 11, 13, 16, 19, 24, 27, 33, 35, 42, 47, 53, 58, 67, 71, 78, 85, 95, 102, 112, 118, 128, 138, 147, 155, 170, 178, 191, 200, 213, 224, 238, 248, 263, 277, 290, 302, 322, 331, 347, 361, 380, 395, 413, 427, 445, 463, 482, 496, 519, 534, 554, 573, 594, 612, 637, 651, 678, 698
OFFSET
1,5
COMMENTS
a(c^n) for some constant c can be expressed as a linear recurrence with constant coefficients.
FORMULA
a(n) = (n^2 - 1 - A374968(n))/6.
a(2^n) = A006095(n).
a(3^n) has the ordinary generating function: x*(1 - 2*x + 5*x^2 + 12*x^3)/(1 - 13*x + 36*x^2 + 12*x^3 - 117*x^4 + 81*x^5).
PROG
(PARI) a(n) = (n^2-1)/6-sum(k=1, n, (k*(k+1)/2)%n)/n+((n+1)%2)/2
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Thomas Scheuerle, Jul 26 2024
STATUS
approved