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.

A004526 Nonnegative integers repeated, floor(n/2).

This page as a plain text file.
%I A004526 #404 Aug 13 2025 18:50:51
%S A004526 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,
%T A004526 14,15,15,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,
%U A004526 26,26,27,27,28,28,29,29,30,30,31,31,32,32,33,33,34,34,35,35,36,36
%N A004526 Nonnegative integers repeated, floor(n/2).
%C A004526 Number of elements in the set {k: 1 <= 2k <= n}.
%C A004526 Dimension of the space of weight 2n+4 cusp forms for Gamma_0(2).
%C A004526 Dimension of the space of weight 1 modular forms for Gamma_1(n+1).
%C A004526 Number of ways 2^n is expressible as r^2 - s^2 with s > 0. Proof: (r+s) and (r-s) both should be powers of 2, even and distinct hence a(2k) = a(2k-1) = (k-1) etc. - _Amarnath Murthy_, Sep 20 2002
%C A004526 Lengths of sides of Ulam square spiral; i.e., lengths of runs of equal terms in A063826. - _Donald S. McDonald_, Jan 09 2003
%C A004526 Number of partitions of n into two parts. A008619 gives partitions of n into at most two parts, so A008619(n) = a(n) + 1 for all n >= 0. Partial sums are A002620 (Quarter-squares). - _Rick L. Shepherd_, Feb 27 2004
%C A004526 a(n+1) is the number of 1's in the binary expansion of the Jacobsthal number A001045(n). - _Paul Barry_, Jan 13 2005
%C A004526 Number of partitions of n+1 into two distinct (nonzero) parts. Example: a(8) = 4 because we have [8,1],[7,2],[6,3] and [5,4]. - _Emeric Deutsch_, Apr 14 2006
%C A004526 Complement of A000035, since A000035(n)+2*a(n) = n. Also equal to the partial sums of A000035. - _Hieronymus Fischer_, Jun 01 2007
%C A004526 Number of binary bracelets of n beads, two of them 0. For n >= 2, a(n-2) is the number of binary bracelets of n beads, two of them 0, with 00 prohibited. - _Washington Bomfim_, Aug 27 2008
%C A004526 Let A be the Hessenberg n X n matrix defined by: A[1,j] = j mod 2, A[i,i]:=1, A[i,i-1] = -1, and A[i,j] = 0 otherwise. Then, for n >= 1, a(n+1) = (-1)^n det(A). - _Milan Janjic_, Jan 24 2010
%C A004526 From _Clark Kimberling_, Mar 10 2011: (Start)
%C A004526 Let RT abbreviate rank transform (A187224). Then
%C A004526 RT(this sequence) = A187484;
%C A004526 RT(this sequence without 1st term) = A026371;
%C A004526 RT(this sequence without 1st 2 terms) = A026367;
%C A004526 RT(this sequence without 1st 3 terms) = A026363. (End)
%C A004526 The diameter (longest path) of the n-cycle. - _Cade Herron_, Apr 14 2011
%C A004526 For n >= 3, a(n-1) is the number of two-color bracelets of n beads, three of them are black, having a diameter of symmetry. - _Vladimir Shevelev_, May 03 2011
%C A004526 Pelesko (2004) refers erroneously to this sequence instead of A008619. - _M. F. Hasler_, Jul 19 2012
%C A004526 Number of degree 2 irreducible characters of the dihedral group of order 2(n+1). - _Eric M. Schmidt_, Feb 12 2013
%C A004526 For n >= 3 the sequence a(n-1) is the number of non-congruent regions with infinite area in the exterior of a regular n-gon with all diagonals drawn. See A217748. - _Martin Renner_, Mar 23 2013
%C A004526 a(n) is the number of partitions of 2n into exactly 2 even parts. a(n+1) is the number of partitions of 2n into exactly 2 odd parts. This just rephrases the comment of E. Deutsch above. - _Wesley Ivan Hurt_, Jun 08 2013
%C A004526 Number of the distinct rectangles and square in a regular n-gon is a(n/2) for even n and n >= 4. For odd n, such number is zero, see illustration in link. - _Kival Ngaokrajang_, Jun 25 2013
%C A004526 x-coordinate from the image of the point (0,-1) after n reflections across the lines y = n and y = x respectively (alternating so that one reflection is applied on each step): (0,-1) -> (0,1) -> (1,0) -> (1,2) -> (2,1) -> (2,3) -> ... . - _Wesley Ivan Hurt_, Jul 12 2013
%C A004526 a(n) is the number of partitions of 2n into exactly two distinct odd parts. a(n-1) is the number of partitions of 2n into exactly two distinct even parts, n > 0. - _Wesley Ivan Hurt_, Jul 21 2013
%C A004526 a(n) is the number of permutations of length n avoiding 213, 231 and 312, or avoiding 213, 312 and 321 in the classical sense which are breadth-first search reading words of increasing unary-binary trees. For more details, see the entry for permutations avoiding 231 at A245898. - _Manda Riehl_, Aug 05 2014
%C A004526 Also a(n) is the number of different patterns of 2-color, 2-partition of n. - _Ctibor O. Zizka_, Nov 19 2014
%C A004526 Minimum in- and out-degree for a directed K_n (see link). - _Jon Perry_, Nov 22 2014
%C A004526 a(n) is also the independence number of the triangular graph T(n). - _Luis Manuel Rivera Martínez_, Mar 12 2015
%C A004526 For n >= 3, a(n+4) is the least positive integer m such that every m-element subset of {1,2,...,n} contains distinct i, j, k with i + j = k (equivalently, with i - j = k). - _Rick L. Shepherd_, Jan 24 2016
%C A004526 More generally, the ordinary generating function for the integers repeated k times is x^k/((1 - x)(1 - x^k)). - _Ilya Gutkovskiy_, Mar 21 2016
%C A004526 a(n) is the number of numbers of the form F(i)*F(j) between F(n+3) and F(n+4), where 2 < i < j and F = A000045 (Fibonacci numbers). - _Clark Kimberling_, May 02 2016
%C A004526 The arithmetic function v_2(n,2) as defined in A289187. - _Robert Price_, Aug 22 2017
%C A004526 a(n) is also the total domination number of the (n-3)-gear graph. - _Eric W. Weisstein_, Apr 07 2018
%C A004526 Consider the numbers 1, 2, ..., n; a(n) is the largest integer t such that these numbers can be arranged in a row so that all consecutive terms differ by at least t. Example: a(6) = a(7) = 3, because of respectively (4, 1, 5, 2, 6, 3) and (1, 5, 2, 6, 3, 7, 4) (see link BMO - Problem 2). - _Bernard Schott_, Mar 07 2020
%C A004526 a(n-1) is also the number of integer-sided triangles whose sides a < b < c are in arithmetic progression with a middle side b = n (see A307136). Example, for b = 4, there exists a(3) = 1 such triangle corresponding to Pythagorean triple (3, 4, 5). For the triples, miscellaneous properties and references, see A336750. - _Bernard Schott_, Oct 15 2020
%C A004526 For n >= 1, a(n-1) is the greatest remainder on division of n by any k in 1..n. - _David James Sycamore_, Sep 05 2021
%C A004526 Number of incongruent right triangles that can be formed from the vertices of a regular n-gon is given by a(n/2) for n even. For n odd such number is zero. For a regular n-gon, the number of incongruent triangles formed from its vertices is given by A069905(n). The number of incongruent acute triangles is given by A005044(n). The number of incongruent obtuse triangles is given by A008642(n-4) for n > 3 otherwise 0, with offset 0. - _Frank M Jackson_, Nov 26 2022
%C A004526 The inverse binomial transform is 0, 0, 1, -2, 4, -8, 16, -32, ... (see A122803). - _R. J. Mathar_, Feb 25 2023
%D A004526 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.
%D A004526 L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 120, P(n,2).
%D A004526 Graham, Knuth and Patashnik, Concrete Mathematics, Addison-Wesley, NY, 1989, page 77 (partitions of n into at most 2 parts).
%H A004526 David Wasserman, <a href="/A004526/b004526.txt">Table of n, a(n) for n = 0..1000</a>
%H A004526 Jonathan Bloom and Nathan McNew, <a href="https://arxiv.org/abs/1908.03953">Counting pattern-avoiding integer partitions</a>, arXiv:1908.03953 [math.CO], 2019.
%H A004526 British Mathematical Olympiad, <a href="https://bmos.ukmt.org.uk/home/bmo1-2012.pdf">2011/2012 - Round 1 - Problem 2</a>.
%H A004526 Shalosh B. Ekhad and Doron Zeilberger, <a href="https://arxiv.org/abs/1901.08172">In How many ways can I carry a total of n coins in my two pockets, and have the same amount in both pockets?</a>, arXiv:1901.08172 [math.CO], 2019.
%H A004526 Ricardo Gómez Aíza, <a href="https://arxiv.org/abs/2402.16111">Trees with flowers: A catalog of integer partition and integer composition trees with their asymptotic analysis</a>, arXiv:2402.16111 [math.CO], 2024. See p. 23.
%H A004526 Andreas M. Hinz and Paul K. Stockmeyer, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL25/Hinz/hinz5.html">Precious Metal Sequences and Sierpinski-Type Graphs</a>, J. Integer Seq., Vol 25 (2022), Article 22.4.8.
%H A004526 Zachary Hoelscher and Eyvindur Ari Palsson, <a href="https://arxiv.org/abs/2011.14502">Counting Restricted Partitions of Integers into Fractions: Symmetry and Modes of the Generating Function and a Connection to omega(t)</a>, arXiv:2011.14502 [math.NT], 2020.
%H A004526 Kival Ngaokrajang, <a href="/A004526/a004526.jpg">The distinct rectangles and square in a regular n-gon for n = 4..18</a>.
%H A004526 John A. Pelesko, <a href="http://www.cs.uwaterloo.ca/journals/JIS/VOL7/Pelesko/pel11.html">Generalizing the Conway-Hofstadter $10,000 Sequence</a>, Journal of Integer Sequences, Vol. 7 (2004), Article 04.3.5.
%H A004526 Jon Perry, <a href="/A004526/a004526.pdf">Square of a directed graph</a>.
%H A004526 William A. Stein, <a href="http://wstein.org/Tables/dimskg0n.gp">Dimensions of the spaces S_k(Gamma_0(N))</a>.
%H A004526 William A. Stein, <a href="http://wstein.org/Tables/">The modular forms database</a>.
%H A004526 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/GearGraph.html">Gear Graph</a>.
%H A004526 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PrimePartition.html">Prime Partition</a>
%H A004526 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/TotalDominationNumber.html">Total Domination Number</a>.
%H A004526 <a href="/index/Cor#core">Index entries for "core" sequences</a>
%H A004526 <a href="/index/O#Olympiads">Index to sequences related to Olympiads</a>
%H A004526 <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (1,1,-1).
%F A004526 G.f.: x^2/((1+x)*(x-1)^2).
%F A004526 a(n) = floor(n/2).
%F A004526 a(n) = ceiling((n+1)/2). - _Eric W. Weisstein_, Jan 11 2024
%F A004526 a(n) = 1 + a(n-2).
%F A004526 a(n) = a(n-1) + a(n-2) - a(n-3).
%F A004526 a(2*n) = a(2*n+1) = n.
%F A004526 a(n+1) = n - a(n). - _Henry Bottomley_, Jul 25 2001
%F A004526 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
%F A004526 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
%F A004526 E.g.f.: ((2*x-1)*exp(x) + exp(-x))/4. - _Paul Barry_, Sep 03 2003
%F A004526 G.f.: (1/(1-x)) * Sum_{k >= 0} t^2/(1-t^4) where t = x^2^k. - _Ralf Stephan_, Feb 24 2004
%F A004526 a(n+1) = A000120(A001045(n)). - _Paul Barry_, Jan 13 2005
%F A004526 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
%F A004526 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
%F A004526 a(n+1) = A002378(n) - A035608(n). - _Reinhard Zumkeller_, Jan 27 2010
%F A004526 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
%F A004526 For n >= 2, a(n) = floor(log_2(2^a(n-1) + 2^a(n-2))). - _Vladimir Shevelev_, Jun 22 2010
%F A004526 a(n) = A180969(2,n). - _Adriano Caroli_, Nov 24 2010
%F A004526 A001057(n-1) = (-1)^n*a(n), n > 0. - _M. F. Hasler_, Jul 19 2012
%F A004526 a(n) = A008615(n) + A002264(n). - _Reinhard Zumkeller_, Apr 28 2014
%F A004526 Euler transform of length 2 sequence [1, 1]. - _Michael Somos_, Jul 03 2014
%e A004526 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 + ...
%p A004526 A004526 := n->floor(n/2); seq(floor(i/2),i=0..50);
%t A004526 Table[(2n - 1)/4 + (-1)^n/4, {n, 0, 70}] (* _Stefan Steinerberger_, Apr 02 2006 *)
%t A004526 f[n_] := If[OddQ[n], (n - 1)/2, n/2]; Array[f, 74, 0] (* _Robert G. Wilson v_, Apr 20 2012 *)
%t A004526 With[{c=Range[0,40]},Riffle[c,c]] (* _Harvey P. Dale_, Aug 26 2013 *)
%t A004526 CoefficientList[Series[x^2/(1 - x - x^2 + x^3), {x, 0, 75}], x] (* _Robert G. Wilson v_, Feb 05 2015 *)
%t A004526 LinearRecurrence[{1, 1, -1}, {0, 0, 1}, 75] (* _Robert G. Wilson v_, Feb 05 2015 *)
%t A004526 Floor[Range[0, 40]/2] (* _Eric W. Weisstein_, Apr 07 2018 *)
%o A004526 (PARI) a(n)=n\2 /* _Jaume Oliver Lafont_, Mar 25 2009 */
%o A004526 (PARI) x='x+O('x^100); concat([0, 0], Vec(x^2/((1+x)*(x-1)^2))) \\ _Altug Alkan_, Mar 21 2016
%o A004526 (Haskell)
%o A004526 a004526 = (`div` 2)
%o A004526 a004526_list = concatMap (\x -> [x, x]) [0..]
%o A004526 -- _Reinhard Zumkeller_, Jul 27 2012
%o A004526 (Maxima) makelist(floor(n/2),n,0,50); /* _Martin Ettl_, Oct 17 2012 */
%o A004526 (Sage) def a(n) : return( dimension_cusp_forms( Gamma0(2), 2*n+4) ); # _Michael Somos_, Jul 03 2014
%o A004526 (Sage) def a(n) : return( dimension_modular_forms( Gamma1(n+1), 1) ); # _Michael Somos_, Jul 03 2014
%o A004526 (Magma) [Floor(n/2): n in [0..100]]; // _Vincenzo Librandi_, Nov 19 2014
%o A004526 (Python)
%o A004526 def a(n): return n//2
%o A004526 print([a(n) for n in range(74)]) # _Michael S. Branicky_, Apr 30 2022
%Y A004526 a(n+2) = A008619(n). See A008619 for more references.
%Y A004526 A001477(n) = a(n+1)+a(n). A000035(n) = a(n+1)-A002456(n).
%Y A004526 a(n) = A008284(n, 2), n >= 1.
%Y A004526 Zero followed by the partial sums of A000035.
%Y A004526 Column 2 of triangle A094953. Second row of A180969.
%Y A004526 Cf. A002264, A002265, A002266, A010761, A010762, A110532, A110533.
%Y A004526 Partial sums: A002620. Other related sequences: A010872, A010873, A010874.
%Y A004526 Cf. similar sequences of the integers repeated k times: A001477 (k = 1), this sequence (k = 2), A002264 (k = 3), A002265 (k = 4), A002266 (k = 5), A152467 (k = 6), A132270 (k = 7), A132292 (k = 8), A059995 (k = 10).
%Y A004526 Cf. A289187, A139756 (binomial transf).
%Y A004526 Cf. A307136, A336750.
%K A004526 nonn,easy,core,nice
%O A004526 0,5
%A A004526 _N. J. A. Sloane_
%E A004526 Partially edited by _Joerg Arndt_, Mar 11 2010, and _M. F. Hasler_, Jul 19 2012