|
|
A212831
|
|
a(4*n) = 2*n, a(2*n+1) = 2*n+1, a(4*n+2) = 2*n+2.
|
|
6
|
|
|
0, 1, 2, 3, 2, 5, 4, 7, 4, 9, 6, 11, 6, 13, 8, 15, 8, 17, 10, 19, 10, 21, 12, 23, 12, 25, 14, 27, 14, 29, 16, 31, 16, 33, 18, 35, 18, 37, 20, 39, 20, 41, 22, 43, 22, 45, 24, 47, 24, 49, 26, 51, 26, 53, 28, 55, 28, 57, 30, 59, 30, 61, 32, 63, 32, 65, 34, 67, 34, 69, 36, 71, 36, 73, 38, 75
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
First differences: (1, 1, 1, -1, 3, -1, 3, -3, 5,...) = (1, A186422).
Second differences: (0, 0, -2, 4, -4, 4, -6, 8, ...) = (-1)^(n+1) * A201629(n).
Interleave the terms with even indices of the companion A215495 and this one to get (A215495(0), A212831(0), A215495(2), A212831(2),...) = (1, 0, 1, 2, 3, 2, 3, 4, 5, 4,...) = A106249, up to the initial term = A083219 = A083220/2.
|
|
LINKS
|
|
|
FORMULA
|
a(n+1) = (A186421(n)=0,1,2,1,4,...) + 1.
a(n+2) - a(n) = 2, 2, 0, 2. (period 4).
a(n) = a(n-2) +a(n-4) -a(n-6); also holds for A215495(n).
G.f.: x*(1+2*x+2*x^2+x^4) / ( (x^2+1)*(x-1)^2*(1+x)^2 ). - R. J. Mathar, Aug 21 2012
a(n) = (1/4)*((1 +(-1)^n)*(1 - (-1)^floor(n/2)) + (3 -(-1)^n)*n). - G. C. Greubel, Apr 25 2018
|
|
MATHEMATICA
|
a[n_] := (1/4)*((-(1 + (-1)^n))*(-1 + (-1)^Floor[n/2]) - (-3 + (-1)^n)*n ); Table[a[n], {n, 0, 84}] (* Jean-François Alcover, Sep 18 2012 *)
LinearRecurrence[{0, 1, 0, 1, 0, -1}, {0, 1, 2, 3, 2, 5}, 80] (* Harvey P. Dale, May 29 2016 *)
|
|
PROG
|
(PARI) for(n=0, 50, print1((1/4)*((1 +(-1)^n)*(1 - (-1)^floor(n/2)) + (3 -(-1)^n)*n), ", ")) \\ G. C. Greubel, Apr 25 2018
(Magma) [(1/4)*((1 +(-1)^n)*(1 - (-1)^Floor(n/2)) + (3 -(-1)^n)*n): n in [0..50]]; // G. C. Greubel, Apr 25 2018
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|