OFFSET
0,4
LINKS
Amiram Eldar, Table of n, a(n) for n = 0..10000
Index entries for linear recurrences with constant coefficients, signature(0,0,0,2,0,0,0,-1).
FORMULA
a(n) = n/4 if n mod 4 = 0, and a(n) = 0 if n mod 4 = 2, and a(n) = n if n mod 2 = 1.
Linear recurrence: a(n) = 2*a(n-4) - a(n-8) for n > 7.
a(n) for n > 0 is multiplicative with a(2^e) = 1 - e if e < 2 and a(2^e) = 2^(e-2) if e > 1 otherwise a(p^e) = p^e for prime p > 2 and e >= 0.
Dirichlet g.f.: Sum_{n>0} a(n)/n^s = (1-1/2^s)^2 * zeta(s-1).
Dirichlet inverse b(n) for n > 0 is multiplicative with b(2^e) = 1 - e and for prime p > 2: b(p) = -p and b(p^e) = 0 if e > 1.
Sum_{k=1..n} a(k) ~ (9/32) * n^2. - Amiram Eldar, Nov 20 2022
EXAMPLE
a(22) = 0 since 22 mod 4 = 2; a(23) = 23 for 23 mod 2 = 1; a(24) = 6 because 24 mod 4 = 0 and 24/4 = 6.
MAPLE
seq(coeff(series(x*(1+3*x^2+x^3+3*x^4+x^6)/(1-x^4)^2, x, n+1), x, n), n=0..80); # Muniru A Asiru, Jul 20 2018
MATHEMATICA
CoefficientList[Series[x (1 + 3 x^2 + x^3 + 3 x^4 + x^6)/(1 - x^4)^2, {x, 0, 80}], x] (* Michael De Vlieger, Jul 20 2018 *)
LinearRecurrence[{0, 0, 0, 2, 0, 0, 0, -1}, {0, 1, 0, 3, 1, 5, 0, 7}, 81] (* Robert G. Wilson v, Jul 21 2018 *)
PROG
(PARI) concat(0, Vec((x*(1+3*x^2+x^3+3*x^4+x^6)/(1-x^4)^2) + O(x^80))) \\ Felix Fröhlich, Jul 09 2018
(PARI) {my(N=79); concat([0], dirdiv(vector(N, n, n), vector(N, n, my(k=valuation(n, 2)); if(n==2^k, k+1, 0))))} \\ Andrew Howroyd, Jul 09 2018
(GAP) a:=[0, 1, 0, 3, 1, 5, 0, 7];; for n in [9..85] do a[n]:=2*a[n-4]-a[n-8]; od; a; # Muniru A Asiru, Jul 20 2018
CROSSREFS
KEYWORD
mult,nonn,easy
AUTHOR
Werner Schulte, Jul 09 2018
STATUS
approved