

A004524


Three even followed by one odd.


24



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

a(n) = A092038(n3) for n > 4.  Reinhard Zumkeller, Mar 28 2004
Ignoring the first term, for n >= 0, n/2 rounded by the method called "banker's rounding", "statistician's rounding", or "roundtoeven" 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
From Anthony Hernandez, Aug 08 2016: (Start)
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 nth 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 (n1) X (n1) white bishop graph.  Eric W. Weisstein, Jun 26 2017
Let (b(n)) be the pINVERT of A010892 using p(S) = 1  S^2; then b(n) = a(n+1) for n >= 0. See A292301.  Clark Kimberling, Sep 30 2017
Also the total domination number of the (n2)complete graph (for n>3), (n2)cycle graph (for n>4), and (n2)pan graph (for n>4).  Eric W. Weisstein, Apr 07 2018


REFERENCES

HsienKuei Hwang, S Janson, TH Tsai, Exact and asymptotic solutions of the recurrence f(n) = f(floor(n/2)) + f(ceiling(n/2)) + g(n): theory and applications, Preprint, 2016; http://140.109.74.92/hk/wpcontent/files/2016/12/aathhrr1.pdf. Also Exact and Asymptotic Solutions of a DivideandConquer Recurrence Dividing at Half: Theory and Applications, ACM Transactions on Algorithms, 13:4 (2017), #47; DOI: 10.1145/3127585


LINKS

Vincenzo Librandi, Table of n, a(n) for n = 0..2000
Eric Weisstein's World of Mathematics, Complete Graph
Eric Weisstein's World of Mathematics, Cycle Graph
Eric Weisstein's World of Mathematics, Domination Number
Eric Weisstein's World of Mathematics, Pan Graph
Eric Weisstein's World of Mathematics, Total Domination Number
Eric Weisstein's World of Mathematics, White Bishop Graph
Wikipedia, Rounding
Index entries for twoway infinite sequences
Index entries for linear recurrences with constant coefficients, signature (2,2,2,1).


FORMULA

a(n) = a(n1)  a(n2) + a(n3) + 1 = (n1)  A004525(n1).  Henry Bottomley, Mar 08 2000
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(2n) for all n in Z.  Michael Somos, Jul 19 2003
E.g.f.: exp(x)*(x1)/2 + cos(x)/2; a(n) = (n2)/2 + 1/2  cos(Pi*(n2)/2)/2.  Paul Barry, Oct 27 2004
a(n+3) = Sum_{k = 0..n} (1+(1)^C(n,2))/2.  Paul Barry, Mar 31 2008
a(n) = (1/2)*(n1) + (1/4)*(i^n + (i)^n), with n >= 0 and i = sqrt(1).  Paolo P. Lava, Dec 16 2008
a(n) = floor(n/4) + floor((n+1)/4).  Arkadiusz Wesolowski, Sep 19 2012
From Wesley Ivan Hurt, Jul 21 2014, Oct 31 2015: (Start)
a(n) = Sum_{i = 1..n1} (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


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

A004524:=n>floor(n/4)+floor((n+1)/4): seq(A004524(n), n=0..50); # Wesley Ivan Hurt, Jul 21 2014


MATHEMATICA

Table[Floor[n/4] + Floor[(n + 1)/4], {n, 0, 50}] (* Wesley Ivan Hurt, Jul 21 2014 *)
Flatten[Table[{n, n, n, n + 1}, {n, 0, 38, 2}]] (* Alonso del Arte, Aug 10 2016 *)
Table[(n + Cos[n Pi/2]  1)/2, {n, 0, 20}] (* Eric W. Weisstein, Apr 07 2018 *)
Table[Floor[n/2  1] + Ceiling[n/4  1/2]  Floor[n/4  1/2], {n, 0, 20}] (* Eric W. Weisstein, Apr 07 2018 *)
LinearRecurrence[{2, 2, 2, 1}, {0, 0, 1, 2}, {0, 20}] (* Eric W. Weisstein, Apr 07 2018 *)
CoefficientList[Series[x^3/((1 + x)^2 (1 + x^2)), {x, 0, 20}], x] (* Eric W. Weisstein, Apr 07 2018 *)


PROG

(PARI) {a(n) = n\4 + (n+1)\4}; /* Michael Somos, Jul 19 2003 */
(PARI) concat([0, 0, 0], Vec(x^3/((1x)^2*(1+x^2)) + O(x^200))) \\ 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
 Reinhard Zumkeller, Feb 22 2013, Jul 14 2012
(MAGMA) [Floor(n/4)+Floor((n+1)/4) : n in [0..50]]; // Wesley Ivan Hurt, Jul 21 2014


CROSSREFS

Cf. A004525, A093390, A093393, A093391, A093392.
Zero followed by partial sums of A021913.
First differences of A011848.
Sequence in context: A113512 A194169 A194165 * A265409 A126257 A025773
Adjacent sequences: A004521 A004522 A004523 * A004525 A004526 A004527


KEYWORD

nonn,easy


AUTHOR

N. J. A. Sloane


STATUS

approved



