OFFSET
0,3
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (0,2,0,-1).
FORMULA
a(n) is multiplicative with a(2^e) = 3 * 2^(e-1) if e>0, a(p^e) = p^e otherwise and a(0) = 1.
Euler transform of length 5 sequence [ 1, 2, 0, 0, -1].
G.f.: (1 - x^5) / ((1 - x) * (1 - x^2)^2).
G.f.: (1 + x + x^2 + x^3 + x^4) / (1 - 2*x^2 + x^4).
a(n) = A080512(n) if n>0.
First difference of A111711.
A188626(n) = p(-1) where p(x) is the unique degree-n polynomial such that p(k) = a(k) for k = 0, 1, ..., n.
From Amiram Eldar, Jan 03 2023: (Start)
Dirichlet g.f.: zeta(s-1)*(1+1/2^s).
Sum_{k=1..n} a(k) ~ (5/8) * n^2. (End)
EXAMPLE
G.f. = 1 + x + 3*x^2 + 3*x^3 + 6*x^4 + 5*x^5 + 9*x^6 + 7*x^7 + 12*x^8 + ...
MATHEMATICA
a[ n_] := Which[ n < 1, Boole[n == 0], OddQ[n], n, True, 3 n/2];
a[ n_] := SeriesCoefficient[ (1 + x + x^2 + x^3 + x^4) / (1 - 2*x^2 + x^4), {x, 0, n}];
PROG
(PARI) {a(n) = if( n<1, n==0, n%2, n, 3*n/2)};
(PARI) {a(n) = if( n<0, 0, polcoeff( (1 - x^5) / ((1 - x) * (1 - x^2)^2) + x * O(x^n), n))};
(Haskell)
import Data.List (transpose)
a257143 n = a257143_list !! n
a257143_list = concat $ transpose [a008486_list, a005408_list]
-- Reinhard Zumkeller, Apr 17 2015
KEYWORD
nonn,mult,easy
AUTHOR
Michael Somos, Apr 16 2015
STATUS
approved