A004525 One even followed by three odd.
0, 1, 1, 1, 2, 3, 3, 3, 4, 5, 5, 5, 6, 7, 7, 7, 8, 9, 9, 9, 10, 11, 11, 11, 12, 13, 13, 13, 14, 15, 15, 15, 16, 17, 17, 17, 18, 19, 19, 19, 20, 21, 21, 21, 22, 23, 23, 23, 24, 25, 25, 25, 26, 27, 27, 27, 28, 29, 29, 29, 30, 31, 31, 31, 32, 33, 33, 33, 34, 35, 35, 35, 36, 37, 37, 37
Offset: 0
Examples
G.f. = x + x^2 + x^3 + 2*x^4 + 3*x^5 + 3*x^6 + 3*x^7 + 4*x^8 + 5*x^9 + ...
References
- A. Adem and R. J. Milgram, Cohomology of Finite Groups, Springer-Verlag, 2nd. ed., 2004; p. 247.
- Y. Ito, I. Nakamura, Hilbert schemes and simple singularities, New trends in algebraic geometry (Warwick, 1996), 151-233, Cambridge University Press, 1999.
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..10000
- Heiko Harborth and Hauke Nienborg, Rook domination on hexagonal hexagon boards, INTEGERS 21A (2021), #A14.
- Eric Weisstein's World of Mathematics, Black Bishop Graph
- Eric Weisstein's World of Mathematics, Domination Number
- Eric Weisstein's World of Mathematics, Moebius Ladder
- Index entries for two-way infinite sequences
- Index entries for linear recurrences with constant coefficients, signature (2,-2,2,-1).
Programs
-
Haskell
a004525 n = a004525_list !! n a004525_list = 0 : 1 : 1 : zipWith3 (\x y z -> x - y + z + 1) a004525_list (tail a004525_list) (drop 2 a004525_list) -- Reinhard Zumkeller, Jul 14 2012
-
Magma
[Floor(n/4) + Ceiling(n/4): n in [0..70]]; // Vincenzo Librandi, Aug 07 2011
-
Maple
A004525 := proc(n): floor(n/4) + ceil(n/4) end: seq(A004525(n), n=0..75); # Johannes W. Meijer, Aug 06 2011
-
Mathematica
Table[Floor[n/4] + Ceiling[n/4], {n, 0, 100}] (* Wesley Ivan Hurt, Oct 22 2013 *) Table[(n + Sin[n Pi/2])/2, {n, 0, 30}] (* Eric W. Weisstein, Jun 30 2017 *) LinearRecurrence[{2, -2, 2, -1}, {1, 1, 1, 2}, {0, 20}] (* Eric W. Weisstein, Jun 30 2017 *) Table[{n - 1, n, n, n}, {n, 1, 41, 2}] // Flatten (* Harvey P. Dale, Oct 18 2019 *)
-
Maxima
makelist((1/4)*(2*n-(1-(-1)^n)*(-1)^(n*(n+1)/2)), n, 0, 75); /* Bruno Berselli, Mar 13 2012 */
-
PARI
{a(n) = n\4 + (n+3)\4}; /* Michael Somos, Jul 19 2003 */
-
Python
def A004525(n): return ((n>>1)&-2)+bool(n&3) # Chai Wah Wu, Jan 27 2023
Formula
a(n) = a(n-1) - a(n-2) + a(n-3) + 1 = n - A004524(n+1). - Henry Bottomley, Mar 08 2000
G.f.: x*(1-x+x^2)/((1-x)^2*(1+x^2)) = x*(1-x^6)/((1-x)*(1-x^3)*(1-x^4)). - Michael Somos, Jul 19 2003
a(n) = -a(-n) for all n in Z. - Michael Somos, Jul 19 2003
a(n) = floor(n/4) + ceiling(n/4). See also A004396, one even followed by two odd and A002620, quarter-squares: floor(n/2)*ceiling(n/2). - Jonathan Vos Post, Mar 19 2006
a(n) = Sum_{k=0..n-1} (1 + (-1)^binomial(k+1, 2))/2. - Paul Barry, Mar 31 2008
E.g.f: A(x) = (x*exp(x) + sin(x))/2. - Vladimir Kruchinin, Feb 20 2011
a(n) = (1/4)*(2*n - (1 - (-1)^n)*(-1)^(n*(n+1)/2)). - Bruno Berselli, Mar 13 2012
a(n) = (n - floor(cos(Pi*(n+1)/2)))/2. - Wesley Ivan Hurt, Oct 22 2013
Euler transform of length 6 sequence [1, 0, 1, 1, 0, -1]. - Michael Somos, Apr 03 2017
a(n) = (n + sin(n*Pi/2))/2. - Wesley Ivan Hurt, Oct 02 2017
a(n) = n-1-a(n-2) for n >= 2. - Kritsada Moomuang, Oct 29 2019
Comments