|
|
A186421
|
|
Even numbers interleaved with repeated odd numbers.
|
|
8
|
|
|
0, 1, 2, 1, 4, 3, 6, 3, 8, 5, 10, 5, 12, 7, 14, 7, 16, 9, 18, 9, 20, 11, 22, 11, 24, 13, 26, 13, 28, 15, 30, 15, 32, 17, 34, 17, 36, 19, 38, 19, 40, 21, 42, 21, 44, 23, 46, 23, 48, 25, 50, 25, 52, 27, 54, 27, 56, 29, 58, 29, 60, 31, 62, 31, 64, 33, 66, 33, 68, 35, 70, 35, 72, 37, 74, 37, 76, 39, 78, 39, 80, 41, 82, 41, 84, 43, 86, 43
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
Row sum of superimposed binary filled triangle. - Craig Knecht, Aug 07 2015
|
|
LINKS
|
|
|
FORMULA
|
a(2*k) = 2*k, a(4*k+1) = a(4*k+3) = 2*k+1.
a(n) = n if n is even, else 2*floor(n/4)+1.
a(2*n-(2*k+1)) + a(2*n+2*k+1) = 2*n, 0 <= k < n.
G.f.: x*(1+2*x+2*x^3+x^4) / ( (1+x^2)*(x-1)^2*(1+x)^2 ). - R. J. Mathar, Feb 23 2011
a(n) = n-(1-(-1)^n)*(n+i^(n(n+1)))/4, where i=sqrt(-1). - Bruno Berselli, Feb 23 2011
E.g.f.: (x*cosh(x) + sin(x) + 2*x*sinh(x))/2. - Stefano Spezia, May 09 2021
|
|
EXAMPLE
|
A005843: 0 2 4 6 8 10 12 14 16 18 20 22
this : 0 1 2 1 4 3 6 3 8 5 10 5 12 7 14 7 16 9 18 9 20 11 22 ... .
|
|
MAPLE
|
|
|
MATHEMATICA
|
Table[n - (1 - (-1)^n)*(n + I^(n (n + 1)))/4, {n, 0, 87}] (* or *)
CoefficientList[Series[x (1 + 2 x + 2 x^3 + x^4)/((1 + x^2) (x - 1)^2 (1 + x)^2), {x, 0, 87}], x] (* or *)
n = 88; Riffle[Range[0, n, 2], Flatten@ Transpose[{Range[1, n, 2], Range[1, n, 2]}]] (* Michael De Vlieger, Jul 14 2015 *)
|
|
PROG
|
(Haskell)
a186421 n = a186421_list !! n
a186421_list = interleave [0, 2..] $ rep [1, 3..] where
interleave (x:xs) ys = x : interleave ys xs
rep (x:xs) = x : x : rep xs
(Maxima) makelist(n-(1-(-1)^n)*(n+%i^(n*(n+1)))/4, n, 0, 90); /* Bruno Berselli, Mar 04 2013 */
(Magma) [IsEven(n) select n else 2*Floor(n/4)+1: n in [0..100]]; // Vincenzo Librandi, Jul 13 2015
(Python)
|
|
CROSSREFS
|
Cf. A186422 (first differences), A186423 (partial sums), A240828 (row sum of superimposed binary triangle).
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|