cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-5 of 5 results.

A004524 Three even followed by one odd.

Original entry on oeis.org

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
Offset: 0

Views

Author

Keywords

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
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 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
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
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
The sequence is the interleaving of the duplicated even integers (A052928) with the nonnegative integers (A001477). - Guenther Schrack, Mar 05 2019

Examples

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

Crossrefs

Zero followed by partial sums of A021913.
First differences of A011848.

Programs

  • GAP
    List([0..79],n->Int(n/4)+Int((n+1)/4)); # Muniru A Asiru, Mar 06 2019
    
  • 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..80]]; // Wesley Ivan Hurt, Jul 21 2014
    
  • 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, 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[(n + Cos[n Pi/2] - 1)/2, {n, 0, 80}] (* Eric W. Weisstein, Apr 07 2018 *)
    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 *)
    Table[Round[(n - 1)/2], {n, 0, 20}] (* Eric W. Weisstein, Jun 19 2024 *)
    Round[(Range[0, 20] - 1)/2] (* Eric W. Weisstein, Jun 19 2024 *)
    Table[PadRight[{},If[EvenQ[n],3,1],n],{n,0,40}]//Flatten (* Harvey P. Dale, Dec 11 2024 *)
  • PARI
    {a(n) = n\4 + (n+1)\4}; /* Michael Somos, Jul 19 2003 */
    
  • PARI
    concat([0,0,0], Vec(x^3/((1-x)^2*(1+x^2)) + O(x^80))) \\ Altug Alkan, Oct 31 2015
    
  • Python
    def A004524(n): return (n>>2)+(n+1>>2) # Chai Wah Wu, Jul 29 2022
  • Sage
    [floor(n/4)+floor((n+1)/4) for n in (0..80)] # G. C. Greubel, Mar 08 2019
    

Formula

a(n) = a(n-1) - a(n-2) + a(n-3) + 1 = (n-1) - A004525(n-1). - 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(2-n) for all n in Z. - Michael Somos, Jul 19 2003
a(n) = A092038(n-3) for n > 4. - Reinhard Zumkeller, Mar 28 2004
From Paul Barry, Oct 27 2004: (Start)
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) = 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..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
Sum_{n>=3} (-1)^(n+1)/a(n) = log(2) (A002162). - Amiram Eldar, Sep 29 2022

A093391 a(n) = floor(n/16) + floor((n+1)/16) + floor((n+2)/16) + floor((n+3)/16).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 6, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 10, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 14, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 18, 19, 20, 20, 20, 20
Offset: 0

Views

Author

Reinhard Zumkeller, Mar 28 2004

Keywords

Crossrefs

Programs

  • Haskell
    a093391 n = sum $ map ((flip div 16) . (+ n)) [0..3] -- Reinhard Zumkeller, Oct 10 2013
    
  • Magma
    [Floor(n/16)+Floor((n+1)/16)+Floor((n+2)/16)+Floor((n+3)/16): n in [0..100]]; // Vincenzo Librandi, Feb 16 2018
  • Mathematica
    Total/@(Floor/@(Partition[Range[0,90],4,1]/16)) (* Harvey P. Dale, Sep 21 2013 *)
    CoefficientList[Series[x^13 / ((1 + x^4) (x^8 + 1) (x - 1)^2), {x, 0, 100}], x] (* Vincenzo Librandi, Feb 16 2018 *)
  • PARI
    a(n) = n\16 + (n+1)\16 + (n+2)\16 + (n+3)\16 \\ Andrew Howroyd, Feb 15 2018
    

Formula

From R. J. Mathar, Mar 22 2011: (Start)
a(n) = +2*a(n-1) -a(n-2) -a(n-4) +2*a(n-5) -a(n-6) -a(n-8) +2*a(n-9) -a(n-10) -a(n-12) +2*a(n-13) -a(n-14).
G.f.: x^13/ ( (1+x^4)*(x^8+1)*(x-1)^2 ).
(End)

A093392 [n/25] + [(n+1)/25] + [(n+2)/25] + [(n+3)/25] + [(n+4)/25].

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 7, 8, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 12, 13, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15
Offset: 0

Views

Author

Reinhard Zumkeller, Mar 28 2004

Keywords

Comments

Conjectured g.f. confirmed with more terms similar to A093390, A093391, A093393.

Crossrefs

Programs

  • Mathematica
    Table[Total[Table[Floor[(n+d)/25],{d,0,4}]],{n,0,90}] (* Harvey P. Dale, Sep 04 2024 *)

Formula

Empirical g.f.: x^21 / ((x-1)^2*(x^20+x^15+x^10+x^5+1)). - Colin Barker, Apr 01 2013

A093393 [n/9] + [n/4] + [(n+1)/9] + [(n+1)/4] + [(n+2)/9].

Original entry on oeis.org

0, 0, 0, 1, 2, 2, 2, 4, 6, 7, 7, 8, 9, 9, 9, 10, 12, 13, 14, 15, 16, 16, 16, 17, 18, 19, 20, 22, 23, 23, 23, 24, 25, 25, 26, 28, 30, 30, 30, 31, 32, 32, 32, 34, 36, 37, 37, 38, 39, 39, 39, 40, 42, 43, 44, 45, 46, 46, 46, 47, 48, 49, 50, 52, 53, 53, 53, 54, 55, 55, 56, 58, 60, 60
Offset: 0

Views

Author

Reinhard Zumkeller, Mar 28 2004

Keywords

Comments

a(n) = A004524(n) + A093390(n).

Programs

  • Mathematica
    Table[Total[Floor[(n+{0,1,2})/9]]+Total[Floor[(n+{0,1})/4]],{n,0,80}] (* or *) LinearRecurrence[{2,-2,1,1,-2,1,1,-2,2,-1},{0,0,0,1,2,2,2,4,6,7},80] (* Harvey P. Dale, Dec 01 2024 *)

Formula

G.f.:(x^3*(2*x^6+x^4+x^3+1))/((x^2+1)*(x^6+x^3+1)*(x-1)^2) [From Maksym Voznyy (voznyy(AT)mail.ru), Jul 27 2009]

A287394 Domination number for camel's graph on a 2 X n board.

Original entry on oeis.org

0, 2, 4, 6, 6, 6, 6, 6, 6, 6, 8, 10, 12, 12, 12, 12, 12, 12, 12, 14, 16, 18, 18, 18, 18, 18, 18, 18, 20, 22, 24, 24, 24, 24, 24, 24, 24, 26, 28, 30, 30, 30, 30, 30, 30, 30, 32, 34, 36, 36, 36, 36, 36, 36, 36, 38, 40, 42, 42, 42, 42, 42, 42, 42, 44, 46, 48, 48
Offset: 0

Views

Author

David Nacin, May 24 2017

Keywords

Comments

Minimum number of camels (from Tamerlane chess and fairy chess) required to dominate a 2 X n board.

Examples

			For n=4 we need a(4)=6 camels to dominate a 2 X 4 board.
		

Crossrefs

Programs

  • Mathematica
    Table[2*(Floor[(i+6)/9]+Floor[(i+7)/9]+Floor[(i+8)/9]), {i, 0, 67}]
  • PARI
    concat(0, Vec(2*x / ((1 - x)^2*(1 + x^3 + x^6)) + O(x^100))) \\ Colin Barker, May 27 2017
  • Python
    [2*(int((i+6)/9)+int((i+7)/9)+int((i+8)/9)) for i in range(68)]
    

Formula

a(n) = 2*(floor((n+6)/9) + floor((n+7)/9) + floor((n+8)/9)).
G.f.: 2*x / ((1 - x)^2*(1 + x^3 + x^6)). - Colin Barker, May 26 2017
a(n) = 2*A093390(n+6).
Showing 1-5 of 5 results.