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”).

A083220
a(n) = n + (n mod 4).
6
0, 2, 4, 6, 4, 6, 8, 10, 8, 10, 12, 14, 12, 14, 16, 18, 16, 18, 20, 22, 20, 22, 24, 26, 24, 26, 28, 30, 28, 30, 32, 34, 32, 34, 36, 38, 36, 38, 40, 42, 40, 42, 44, 46, 44, 46, 48, 50, 48, 50, 52, 54, 52, 54, 56, 58, 56, 58, 60, 62, 60, 62, 64, 66, 64, 66, 68, 70, 68, 70, 72, 74
OFFSET
0,2
FORMULA
a(n) = 2*A083219(n).
a(n) = a(n-1) + 2*(n mod 2 + (n mod 4 -1)*(1- n mod 2)), a(0)=0.
a(n) = (3 - (-1)^n - (1+i)*(-i)^n - (1-i)*i^n + 2*n)/2 where i=sqrt(-1). - Colin Barker, Oct 13 2014
G.f.: -2*x*(x^3-x^2-x-1) / ((x-1)^2*(x+1)*(x^2+1)). - Colin Barker, Oct 13 2014
For n > 4, a(n) = a(n-4) + 4. - Zak Seidov, Feb 23 2017
G.f.: 1/(1-x)^2 + 1/(2*(1-x)) - 1/(2*(1+x)) - (1+x)/(1+x^2). - Michael Somos, Feb 23 2017
E.g.f.: (1 + x)*cosh(x) - cos(x) + (2 + x)*sinh(x) - sin(x). - Stefano Spezia, May 28 2021
Sum_{n>=1} (-1)^(n+1)/a(n) = log(2) - 1/2 (A187832). - Amiram Eldar, Aug 21 2023
EXAMPLE
G.f. = 2*x + 4*x^2 + 6*x^3 + 4*x^4 + 6*x^5 + 8*x^6 + 10*x^7 + 8*x^8 + 10*x^9 + ...
MATHEMATICA
a[n_] := Mod[n, 4] + n; (* Michael Somos, Feb 23 2017 *)
PROG
(PARI) concat(0, Vec(-2*x*(x^3-x^2-x-1)/((x-1)^2*(x+1)*(x^2+1)) + O(x^100))) \\ Colin Barker, Oct 13 2014
(PARI) {a(n) = n%4 + n}; /* Michael Somos, Feb 23 2017 */
CROSSREFS
Cf. A010873 (n mod 4), A083219, A187832.
Sequence in context: A337937 A138125 A098793 * A085896 A351491 A107701
KEYWORD
nonn,easy
AUTHOR
Reinhard Zumkeller, Apr 22 2003
STATUS
approved