A004526 Nonnegative integers repeated, floor(n/2).
0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 36
Offset: 0
Examples
G.f. = x^2 + x^3 + 2*x^4 + 2*x^5 + 3*x^6 + 3*x^7 + 4*x^8 + 4*x^9 + 5*x^10 + ...
References
- G. L. Alexanderson et al., The William Powell Putnam Mathematical Competition - Problems and Solutions: 1965-1984, M.A.A., 1985; see Problem A-1 of 27th Competition.
- L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 120, P(n,2).
- Graham, Knuth and Patashnik, Concrete Mathematics, Addison-Wesley, NY, 1989, page 77 (partitions of n into at most 2 parts).
Links
- David Wasserman, Table of n, a(n) for n = 0..1000
- Jonathan Bloom and Nathan McNew, Counting pattern-avoiding integer partitions, arXiv:1908.03953 [math.CO], 2019.
- British Mathematical Olympiad, 2011/2012 - Round 1 - Problem 2.
- Shalosh B. Ekhad and Doron Zeilberger, In How many ways can I carry a total of n coins in my two pockets, and have the same amount in both pockets?, arXiv:1901.08172 [math.CO], 2019.
- Ricardo Gómez Aíza, Trees with flowers: A catalog of integer partition and integer composition trees with their asymptotic analysis, arXiv:2402.16111 [math.CO], 2024. See p. 23.
- Andreas M. Hinz and Paul K. Stockmeyer, Precious Metal Sequences and Sierpinski-Type Graphs, J. Integer Seq., Vol 25 (2022), Article 22.4.8.
- Zachary Hoelscher and Eyvindur Ari Palsson, Counting Restricted Partitions of Integers into Fractions: Symmetry and Modes of the Generating Function and a Connection to omega(t), arXiv:2011.14502 [math.NT], 2020.
- Kival Ngaokrajang, The distinct rectangles and square in a regular n-gon for n = 4..18.
- John A. Pelesko, Generalizing the Conway-Hofstadter $10,000 Sequence, Journal of Integer Sequences, Vol. 7 (2004), Article 04.3.5.
- Jon Perry, Square of a directed graph.
- William A. Stein, Dimensions of the spaces S_k(Gamma_0(N)).
- William A. Stein, The modular forms database.
- Eric Weisstein's World of Mathematics, Gear Graph.
- Eric Weisstein's World of Mathematics, Prime Partition
- Eric Weisstein's World of Mathematics, Total Domination Number.
- Index entries for "core" sequences
- Index to sequences related to Olympiads
- Index entries for linear recurrences with constant coefficients, signature (1,1,-1).
Crossrefs
Programs
-
Haskell
a004526 = (`div` 2) a004526_list = concatMap (\x -> [x, x]) [0..] -- Reinhard Zumkeller, Jul 27 2012
-
Magma
[Floor(n/2): n in [0..100]]; // Vincenzo Librandi, Nov 19 2014
-
Maple
A004526 := n->floor(n/2); seq(floor(i/2),i=0..50);
-
Mathematica
Table[(2n - 1)/4 + (-1)^n/4, {n, 0, 70}] (* Stefan Steinerberger, Apr 02 2006 *) f[n_] := If[OddQ[n], (n - 1)/2, n/2]; Array[f, 74, 0] (* Robert G. Wilson v, Apr 20 2012 *) With[{c=Range[0,40]},Riffle[c,c]] (* Harvey P. Dale, Aug 26 2013 *) CoefficientList[Series[x^2/(1 - x - x^2 + x^3), {x, 0, 75}], x] (* Robert G. Wilson v, Feb 05 2015 *) LinearRecurrence[{1, 1, -1}, {0, 0, 1}, 75] (* Robert G. Wilson v, Feb 05 2015 *) Floor[Range[0, 40]/2] (* Eric W. Weisstein, Apr 07 2018 *)
-
Maxima
makelist(floor(n/2),n,0,50); /* Martin Ettl, Oct 17 2012 */
-
PARI
a(n)=n\2 /* Jaume Oliver Lafont, Mar 25 2009 */
-
PARI
x='x+O('x^100); concat([0, 0], Vec(x^2/((1+x)*(x-1)^2))) \\ Altug Alkan, Mar 21 2016
-
Python
def a(n): return n//2 print([a(n) for n in range(74)]) # Michael S. Branicky, Apr 30 2022
-
Sage
def a(n) : return( dimension_cusp_forms( Gamma0(2), 2*n+4) ); # Michael Somos, Jul 03 2014
-
Sage
def a(n) : return( dimension_modular_forms( Gamma1(n+1), 1) ); # Michael Somos, Jul 03 2014
Formula
G.f.: x^2/((1+x)*(x-1)^2).
a(n) = floor(n/2).
a(n) = ceiling((n+1)/2). - Eric W. Weisstein, Jan 11 2024
a(n) = 1 + a(n-2).
a(n) = a(n-1) + a(n-2) - a(n-3).
a(2*n) = a(2*n+1) = n.
a(n+1) = n - a(n). - Henry Bottomley, Jul 25 2001
For n > 0, a(n) = Sum_{i=1..n} (1/2)/cos(Pi*(2*i-(1-(-1)^n)/2)/(2*n+1)). - Benoit Cloitre, Oct 11 2002
a(n) = (2*n-1)/4 + (-1)^n/4; a(n+1) = Sum_{k=0..n} k*(-1)^(n+k). - Paul Barry, May 20 2003
E.g.f.: ((2*x-1)*exp(x) + exp(-x))/4. - Paul Barry, Sep 03 2003
G.f.: (1/(1-x)) * Sum_{k >= 0} t^2/(1-t^4) where t = x^2^k. - Ralf Stephan, Feb 24 2004
a(n) = (n-(1-(-1)^n)/2)/2 = (1/2)*(n-|sin(n*Pi/2)|). Likewise: a(n) = (n-A000035(n))/2. Also: a(n) = Sum_{k=0..n} A000035(k). - Hieronymus Fischer, Jun 01 2007
The expression floor((x^2-1)/(2*x)) (x >= 1) produces this sequence. - Mohammad K. Azarian, Nov 08 2007; corrected by M. F. Hasler, Nov 17 2008
a(n+1) = A002620(n+1) - A002620(n) = floor((n+1)/2)*ceiling((n+1)/2) - floor(n^2/4). - Jonathan Vos Post, May 20 2010
For n >= 2, a(n) = floor(log_2(2^a(n-1) + 2^a(n-2))). - Vladimir Shevelev, Jun 22 2010
a(n) = A180969(2,n). - Adriano Caroli, Nov 24 2010
A001057(n-1) = (-1)^n*a(n), n > 0. - M. F. Hasler, Jul 19 2012
Euler transform of length 2 sequence [1, 1]. - Michael Somos, Jul 03 2014
Extensions
Partially edited by Joerg Arndt, Mar 11 2010, and M. F. Hasler, Jul 19 2012
Comments