|
|
A004524
|
|
Three even followed by one odd.
|
|
31
|
|
|
0, 0, 0, 1, 2, 2, 2, 3, 4, 4, 4, 5, 6, 6, 6, 7, 8, 8, 8, 9, 10, 10, 10, 11, 12, 12, 12, 13, 14, 14, 14, 15, 16, 16, 16, 17, 18, 18, 18, 19, 20, 20, 20, 21, 22, 22, 22, 23, 24, 24, 24, 25, 26, 26, 26, 27, 28, 28, 28, 29, 30, 30, 30, 31, 32, 32, 32, 33, 34, 34, 34, 35, 36, 36, 36, 37
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,5
|
|
COMMENTS
|
Ignoring the first term, for n >= 0, n/2 rounded by the method called "banker's rounding", "statistician's rounding", or "round-to-even" gives 0, 0, 1, 2, 2, 2, 3, ..., where this method rounds k + 0.5 to k if positive integer k is even but rounds k + 0.5 to k + 1 when k + 1 is even. (If the method is indeed defined such that the above statement is also true with the word "positive" removed, then the first 0 term need not be ignored and this sequence can be further extended symmetrically with a(m) = -a(-m) for all integers m, an advantage over usual rounding.) The corresponding sequence for n/2 rounded by the common method is A004526 (considered as beginning with n = -1). - Rick L. Shepherd, Nov 16 2006
Arrange the positive integers starting at 1 into a triangular array
1
2 3
4 5 6
7 8 9 10
11 12 13 14 15
16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31 32 33 34 35 36
and let e(n) count the even numbers in the n-th row of the array. Then e(n) = a(n+1). For example, e(6) = a(7) = 3 and there are three even numbers in the 6th row of the array. For the count of odd numbers, f(n), look at the sequence A004525. (End)
Also the domination number of the (n-1) X (n-1) white bishop graph. - Eric W. Weisstein, Jun 26 2017
Also the total domination number of the (n-2)-complete graph (for n>3), (n-2)-cycle graph (for n>4), and (n-2)-pan graph (for n>4). - Eric W. Weisstein, Apr 07 2018
|
|
LINKS
|
Eric Weisstein's World of Mathematics, Pan Graph.
|
|
FORMULA
|
G.f.: x^3/((1 - x)^2*(1 + x^2)) = x^3*(1 - x^2)/((1 - x)^2*(1 - x^4)). - Michael Somos, Jul 19 2003
If the sequence is extended to negative arguments in the natural way, it satisfies a(n) = -a(2-n) for all n in Z. - Michael Somos, Jul 19 2003
E.g.f.: (exp(x)*(x-1) + cos(x))/2.
a(n) = (n - 1 - cos(Pi*(n-2)/2))/2. (End)
a(n+3) = Sum_{k = 0..n} (1 + (-1)^C(n,2))/2. - Paul Barry, Mar 31 2008
a(n) = Sum_{i = 1..n-1} (floor(i/2) mod 2).
a(n) = n/2 - sqrt(n^2 mod 8)/2. (End)
Euler transform of length 4 sequence [2, -1, 0, 1]. - Michael Somos, Apr 03 2017
a(n) = (2*n - 2 + (1 + (-1)^n)*(-1)^(n*(n-1)/2))/4. - Guenther Schrack, Mar 04 2019
|
|
EXAMPLE
|
G.f. = x^3 + 2*x^4 + 2*x^5 + 2*x^6 + 3*x^7 + 4*x^8 + 4*x^9 + 4*x^10 + ...
|
|
MAPLE
|
|
|
MATHEMATICA
|
Table[Floor[n/4] + Floor[(n + 1)/4], {n, 0, 80}] (* Wesley Ivan Hurt, Jul 21 2014 *)
Flatten[Table[{n, n, n, n + 1}, {n, 0, 38, 2}]] (* Alonso del Arte, Aug 10 2016 *)
Table[Floor[n/2 - 1] + Ceiling[n/4 - 1/2] - Floor[n/4 - 1/2], {n, 0, 80}] (* Eric W. Weisstein, Apr 07 2018 *)
LinearRecurrence[{2, -2, 2, -1}, {0, 0, 1, 2}, {0, 80}] (* Eric W. Weisstein, Apr 07 2018 *)
CoefficientList[Series[x^3/((1 - x)^2 (1 + x^2)), {x, 0, 80}], x] (* Eric W. Weisstein, Apr 07 2018 *)
|
|
PROG
|
(PARI) concat([0, 0, 0], Vec(x^3/((1-x)^2*(1+x^2)) + O(x^80))) \\ Altug Alkan, Oct 31 2015
(Haskell)
a004524 n = n `div` 4 + (n + 1) `div` 4
a004524_list = 0 : 0 : 0 : 1 : map (+ 2) a004524_list
(Magma) [Floor(n/4)+Floor((n+1)/4) : n in [0..80]]; // Wesley Ivan Hurt, Jul 21 2014
(GAP) List([0..79], n->Int(n/4)+Int((n+1)/4)); # Muniru A Asiru, Mar 06 2019
(Sage) [floor(n/4)+floor((n+1)/4) for n in (0..80)] # G. C. Greubel, Mar 08 2019
(Python)
|
|
CROSSREFS
|
Cf. A002162, A001477, A004525, A004526, A010892, A052928, A092038, A093390, A093391, A093392, A093393, A292301.
Zero followed by partial sums of A021913.
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|