OFFSET
0,2
COMMENTS
This sequence and A165998 form a complementary pair as solutions of alternating sequences a(n) + b(n) = 4*n (A008586), and a(n)*b(n) = 3*n^2 (A033428).
This is the particular case of the two integer sequences x(n)=2n and y(n)=n, where more generally, x(n) + y(n) = 2*a(n) and x(n)*y(n) = (a(n) + b(n)) * (a(n) - b(n)) give the two conjugate binomials a(n) = x(n) + (-1)^n*y(n) and b(n) = x(n) - (-1)^n*y(n) as solutions over the integer domain.
For every integer k: a(n*k) = n*k is multiplicative for nonnegative even integers n and a(n*k) = n*a(k) for nonnegative odd integers n.
For every nonnegative odd integer k, the k-th difference of a(k*n)/k = (2n+1)*(-1)^n + 2 = A166519(n), and 1 for all nonnegative even integers.
a(6n+1)/3 = 6n+1, and a(6n+5)/3 = 6n+5, related to Collatz Conjecture.
Half-periods of a(k) mod n is A026741(n).
LINKS
Index entries for linear recurrences with constant coefficients, signature (0,2,0,-1).
FORMULA
G.f.: x*(3 + 2*x + 3*x^2)/(1 - x^2)^2.
E.g.f.: x*(3*cosh(x) + sinh(x)).
Dirichlet g.f.: 2^(-s) * (3*2^s - 4) * zeta(s-1) = (3 - 4/2^s) * zeta(s-1) = (3 - 1/2^(s-2)) * zeta(s-1).
a(n) = n*(2-(-1)^n) = 3*n / (2+(-1)^n).
a(n) = 3*n if n odd, a(n) = n if n even, implies a(a(2n)) = 2n, a(a(2n+1)) = 9*a(2n+1).
a(n) = 3*b(n), if n odd and a(n) = b(n)/3, if n even, with b(n) = A165998(n).
a(n) = a(a(2k*n)/(2k)) = a((2k+1)*n) / (2k+1), since a(2*k*n) / (2*k) = n.
a(n) = 4*n - A165998(n).
a(n+1) = a(n) + A086970(n+1)*(-1)^n.
a(n) = n*A010684(n). - Michel Marcus, Sep 13 2021
For positive integers k and n, a(n) = A(n,1) = n * (A(n,k)/n)^(1/k), where the k-th nesting composition A(n,k) = a(a(...a(a(n))...)) = n * ( a(n) / n )^k, and d.g.f. of A(n,k) = (2^(1-s) + (1-2^(1-s))*3^k) * zeta(s-1). - Federico Provvedi, Sep 18 2021
a(n+1) = A165998(n)*(1 + 1/n). - Federico Provvedi, Sep 19 2021
MATHEMATICA
Table[n(2-(-1)^n), {n, 0, 99}] (* or *)
LinearRecurrence[{0, 2, 0, -1}, {0, 3, 2, 9}, 100] (* or *)
If[EvenQ@#, #, 3#]&/@Range[0, 99] (* or *)
Drop[Flatten@Transpose[{2#, 6#+3}&@Range[0, Quotient[#, 2]]], -Boole@EvenQ@#]&@(10^2)
PROG
(Sage) (x*(3+2*x+3*x^2)/(1-x^2)^2).series(x, 65).coefficients(x, sparse=False) # Stefano Spezia, Aug 30 2021
(PARI) a(n) = n*(2-(-1)^n); \\ Michel Marcus, Sep 13 2021
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Federico Provvedi, Aug 29 2021
STATUS
approved