login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A004524 Three even followed by one odd. 31

%I #138 Dec 27 2023 11:20:14

%S 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,

%T 14,14,15,16,16,16,17,18,18,18,19,20,20,20,21,22,22,22,23,24,24,24,25,

%U 26,26,26,27,28,28,28,29,30,30,30,31,32,32,32,33,34,34,34,35,36,36,36,37

%N Three even followed by one odd.

%C 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

%C From _Anthony Hernandez_, Aug 08 2016: (Start)

%C Arrange the positive integers starting at 1 into a triangular array

%C 1

%C 2 3

%C 4 5 6

%C 7 8 9 10

%C 11 12 13 14 15

%C 16 17 18 19 20 21

%C 22 23 24 25 26 27 28

%C 29 30 31 32 33 34 35 36

%C 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)

%C Also the domination number of the (n-1) X (n-1) white bishop graph. - _Eric W. Weisstein_, Jun 26 2017

%C Let (b(n)) be the p-INVERT of A010892 using p(S) = 1 - S^2; then b(n) = a(n+1) for n >= 0. See A292301. - _Clark Kimberling_, Sep 30 2017

%C 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

%C The sequence is the interleaving of the duplicated even integers (A052928) with the nonnegative integers (A001477). - _Guenther Schrack_, Mar 05 2019

%H Vincenzo Librandi, <a href="/A004524/b004524.txt">Table of n, a(n) for n = 0..2000</a>

%H Charles H. Conley and Valentin Ovsienko, <a href="https://arxiv.org/abs/2209.10426">Shadows of rationals and irrationals: supersymmetric continued fractions and the super modular group</a>, arXiv:2209.10426 [math-ph], 2022.

%H Hsien-Kuei Hwang, S. Janson, and T.-H. Tsai, <a href="http://140.109.74.92/hk/wp-content/files/2016/12/aat-hhrr-1.pdf">Exact and asymptotic solutions of the recurrence f(n) = f(floor(n/2)) + f(ceiling(n/2)) + g(n): theory and applications</a>, Preprint 2016.

%H Hsien-Kuei Hwang, S. Janson, and T.-H. Tsai, <a href="https://doi.org/10.1145/3127585">Exact and Asymptotic Solutions of a Divide-and-Conquer Recurrence Dividing at Half: Theory and Applications</a>, ACM Transactions on Algorithms, 13:4 (2017), #47; DOI: 10.1145/3127585.

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/CompleteGraph.html">Complete Graph</a>.

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/CycleGraph.html">Cycle Graph</a>.

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/DominationNumber.html">Domination Number</a>.

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/PanGraph.html">Pan Graph</a>.

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/TotalDominationNumber.html">Total Domination Number</a>.

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/WhiteBishopGraph.html">White Bishop Graph</a>.

%H Wikipedia, <a href="http://wikipedia.org/wiki/Rounding">Rounding</a>.

%H <a href="/index/Rec#order_04">Index entries for linear recurrences with constant coefficients</a>, signature (2,-2,2,-1).

%H <a href="/index/Tu#2wis">Index entries for two-way infinite sequences</a>.

%F a(n) = a(n-1) - a(n-2) + a(n-3) + 1 = (n-1) - A004525(n-1). - _Henry Bottomley_, Mar 08 2000

%F 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

%F 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

%F a(n) = A092038(n-3) for n > 4. - _Reinhard Zumkeller_, Mar 28 2004

%F From _Paul Barry_, Oct 27 2004: (Start)

%F E.g.f.: (exp(x)*(x-1) + cos(x))/2.

%F a(n) = (n - 1 - cos(Pi*(n-2)/2))/2. (End)

%F a(n+3) = Sum_{k = 0..n} (1 + (-1)^C(n,2))/2. - _Paul Barry_, Mar 31 2008

%F a(n) = floor(n/4) + floor((n+1)/4). - _Arkadiusz Wesolowski_, Sep 19 2012

%F From _Wesley Ivan Hurt_, Jul 21 2014, Oct 31 2015: (Start)

%F a(n) = Sum_{i = 1..n-1} (floor(i/2) mod 2).

%F a(n) = n/2 - sqrt(n^2 mod 8)/2. (End)

%F Euler transform of length 4 sequence [2, -1, 0, 1]. - _Michael Somos_, Apr 03 2017

%F a(n) = (2*n - 2 + (1 + (-1)^n)*(-1)^(n*(n-1)/2))/4. - _Guenther Schrack_, Mar 04 2019

%F Sum_{n>=3} (-1)^(n+1)/a(n) = log(2) (A002162). - _Amiram Eldar_, Sep 29 2022

%e 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 + ...

%p A004524:=n->floor(n/4)+floor((n+1)/4): seq(A004524(n), n=0..50); # _Wesley Ivan Hurt_, Jul 21 2014

%t Table[Floor[n/4] + Floor[(n + 1)/4], {n, 0, 80}] (* _Wesley Ivan Hurt_, Jul 21 2014 *)

%t Flatten[Table[{n, n, n, n + 1}, {n, 0, 38, 2}]] (* _Alonso del Arte_, Aug 10 2016 *)

%t Table[(n + Cos[n Pi/2] - 1)/2, {n, 0, 80}] (* _Eric W. Weisstein_, Apr 07 2018 *)

%t Table[Floor[n/2 - 1] + Ceiling[n/4 - 1/2] - Floor[n/4 - 1/2], {n, 0, 80}] (* _Eric W. Weisstein_, Apr 07 2018 *)

%t LinearRecurrence[{2, -2, 2, -1}, {0, 0, 1, 2}, {0, 80}] (* _Eric W. Weisstein_, Apr 07 2018 *)

%t CoefficientList[Series[x^3/((1 - x)^2 (1 + x^2)), {x, 0, 80}], x] (* _Eric W. Weisstein_, Apr 07 2018 *)

%o (PARI) {a(n) = n\4 + (n+1)\4}; /* _Michael Somos_, Jul 19 2003 */

%o (PARI) concat([0,0,0], Vec(x^3/((1-x)^2*(1+x^2)) + O(x^80))) \\ _Altug Alkan_, Oct 31 2015

%o (Haskell)

%o a004524 n = n `div` 4 + (n + 1) `div` 4

%o a004524_list = 0 : 0 : 0 : 1 : map (+ 2) a004524_list

%o -- _Reinhard Zumkeller_, Feb 22 2013, Jul 14 2012

%o (Magma) [Floor(n/4)+Floor((n+1)/4) : n in [0..80]]; // _Wesley Ivan Hurt_, Jul 21 2014

%o (GAP) List([0..79],n->Int(n/4)+Int((n+1)/4)); # _Muniru A Asiru_, Mar 06 2019

%o (Sage) [floor(n/4)+floor((n+1)/4) for n in (0..80)] # _G. C. Greubel_, Mar 08 2019

%o (Python)

%o def A004524(n): return (n>>2)+(n+1>>2) # _Chai Wah Wu_, Jul 29 2022

%Y Cf. A002162, A001477, A004525, A004526, A010892, A052928, A092038, A093390, A093391, A093392, A093393, A292301.

%Y Zero followed by partial sums of A021913.

%Y First differences of A011848.

%K nonn,easy

%O 0,5

%A _N. J. A. Sloane_

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 18 22:56 EDT 2024. Contains 370952 sequences. (Running on oeis4.)